Ejemplo n.º 1
0
        public DrugPrescriptionEntity DrugPrescriptionRaised(PrescriptionDto entity)
        {
            var prescribeMessage = new DrugPrescriptionEntity()
            {
                MESSAGE_HEADER =
                {
                    SENDING_APPLICATION   = "IQCARE",
                    SENDING_FACILITY      = "13050",
                    RECEIVING_APPLICATION = "IL",
                    RECEIVING_FACILITY    = "",
                    MESSAGE_DATETIME      = "201709221034",// entity.CommonOrderDetails.TransactionDatetime,
                    SECURITY      = "",
                    MESSAGE_TYPE  = "RDE^001",
                    PROCESSING_ID = "P"
                },
                PATIENT_IDENTIFICATION =
                {
                    INTERNAL_PATIENT_ID = new List <INTERNALPATIENTID>()
                },
                COMMON_ORDER_DETAILS =
                {
                    ORDER_CONTROL       = entity.CommonOrderDetails.OrderControl,
                    PLACER_ORDER_NUMBER = { NUMBER = entity.CommonOrderDetails.PlacerOrderNumber.Number.ToString(), ENTITY = "IQCARE" },
                    ORDER_STATUS        = entity.CommonOrderDetails.OrderStatus,
                    ORDERING_PHYSICIAN  =
                    {
                        FIRST_NAME  = entity.CommonOrderDetails.OrderingPhysician.FirstName,
                        MIDDLE_NAME = entity.CommonOrderDetails.OrderingPhysician.MiddleName,
                        LAST_NAME   = entity.CommonOrderDetails.OrderingPhysician.LastName
                    },
                    TRANSACTION_DATETIME = entity.CommonOrderDetails.TransactionDatetime.ToShortDateString()
                },
                PHARMACY_ENCODED_ORDER = new List <PHARMACYENCODEDORDER>()
            };

            // return prescribeMessage;

            throw new NotImplementedException();
        }
Ejemplo n.º 2
0
        public DrugPrescriptionEntity DrugPrescriptionRaised(PrescriptionSourceDto entityDto)
        {
            DrugPrescriptionEntity drugPrescriptionEntity = new DrugPrescriptionEntity();

            drugPrescriptionEntity.MESSAGE_HEADER.SENDING_FACILITY      = entityDto.MESSAGE_HEADER.SENDING_FACILITY;
            drugPrescriptionEntity.MESSAGE_HEADER.MESSAGE_DATETIME      = entityDto.MESSAGE_HEADER.MESSAGE_DATETIME.ToString("yyyyMMddHmmss");
            drugPrescriptionEntity.MESSAGE_HEADER.MESSAGE_TYPE          = entityDto.MESSAGE_HEADER.MESSAGE_TYPE;
            drugPrescriptionEntity.MESSAGE_HEADER.PROCESSING_ID         = entityDto.MESSAGE_HEADER.PROCESSING_ID;
            drugPrescriptionEntity.MESSAGE_HEADER.RECEIVING_APPLICATION = entityDto.MESSAGE_HEADER.RECEIVING_APPLICATION;
            drugPrescriptionEntity.MESSAGE_HEADER.RECEIVING_FACILITY    = entityDto.MESSAGE_HEADER.RECEIVING_FACILITY;
            drugPrescriptionEntity.MESSAGE_HEADER.SECURITY            = entityDto.MESSAGE_HEADER.SECURITY;
            drugPrescriptionEntity.MESSAGE_HEADER.SENDING_APPLICATION = entityDto.MESSAGE_HEADER.SENDING_APPLICATION;

            drugPrescriptionEntity.PATIENT_IDENTIFICATION.EXTERNAL_PATIENT_ID.ID = entityDto.PATIENT_IDENTIFICATION.EXTERNAL_PATIENT_ID.ID;
            drugPrescriptionEntity.PATIENT_IDENTIFICATION.EXTERNAL_PATIENT_ID.IDENTIFIER_TYPE     = entityDto.PATIENT_IDENTIFICATION.EXTERNAL_PATIENT_ID.IDENTIFIER_TYPE;
            drugPrescriptionEntity.PATIENT_IDENTIFICATION.EXTERNAL_PATIENT_ID.ASSIGNING_AUTHORITY = entityDto.PATIENT_IDENTIFICATION.EXTERNAL_PATIENT_ID.ASSIGNING_AUTHORITY;

            var internalPatientId = new List <MappingEntities.drugs.INTERNAL_PATIENT_ID>();

            foreach (var identifier in entityDto.PATIENT_IDENTIFICATION.INTERNAL_PATIENT_ID)
            {
                var internalIdentity = new MappingEntities.drugs.INTERNAL_PATIENT_ID()
                {
                    ASSIGNING_AUTHORITY = identifier.IDENTIFIER_TYPE,
                    ID = identifier.ID,
                    IDENTIFIER_TYPE = identifier.IDENTIFIER_TYPE
                };

                internalPatientId.Add(internalIdentity);
            }

            drugPrescriptionEntity.PATIENT_IDENTIFICATION.INTERNAL_PATIENT_ID      = internalPatientId;
            drugPrescriptionEntity.PATIENT_IDENTIFICATION.PATIENT_NAME.FIRST_NAME  = entityDto.PATIENT_IDENTIFICATION.PATIENT_NAME.FIRST_NAME;
            drugPrescriptionEntity.PATIENT_IDENTIFICATION.PATIENT_NAME.LAST_NAME   = entityDto.PATIENT_IDENTIFICATION.PATIENT_NAME.MIDDLE_NAME;
            drugPrescriptionEntity.PATIENT_IDENTIFICATION.PATIENT_NAME.MIDDLE_NAME = entityDto.PATIENT_IDENTIFICATION.PATIENT_NAME.LAST_NAME;

            drugPrescriptionEntity.COMMON_ORDER_DETAILS.ORDERING_PHYSICIAN.FIRST_NAME  = entityDto.COMMON_ORDER_DETAILS.ORDERING_PHYSICIAN.FIRST_NAME;
            drugPrescriptionEntity.COMMON_ORDER_DETAILS.ORDERING_PHYSICIAN.MIDDLE_NAME = entityDto.COMMON_ORDER_DETAILS.ORDERING_PHYSICIAN.MIDDLE_NAME;
            drugPrescriptionEntity.COMMON_ORDER_DETAILS.ORDERING_PHYSICIAN.LAST_NAME   = entityDto.COMMON_ORDER_DETAILS.ORDERING_PHYSICIAN.LAST_NAME;

            drugPrescriptionEntity.COMMON_ORDER_DETAILS.NOTES         = entityDto.COMMON_ORDER_DETAILS.NOTES;
            drugPrescriptionEntity.COMMON_ORDER_DETAILS.ORDER_CONTROL = entityDto.COMMON_ORDER_DETAILS.ORDER_CONTROL;
            drugPrescriptionEntity.COMMON_ORDER_DETAILS.ORDER_STATUS  = entityDto.COMMON_ORDER_DETAILS.ORDER_STATUS;
            drugPrescriptionEntity.COMMON_ORDER_DETAILS.PLACER_ORDER_NUMBER.NUMBER = Convert.ToInt32(entityDto.COMMON_ORDER_DETAILS.PLACER_ORDER_NUMBER.NUMBER);
            drugPrescriptionEntity.COMMON_ORDER_DETAILS.PLACER_ORDER_NUMBER.ENTITY = entityDto.COMMON_ORDER_DETAILS.PLACER_ORDER_NUMBER.ENTITY;
            drugPrescriptionEntity.COMMON_ORDER_DETAILS.TRANSACTION_DATETIME       = entityDto.COMMON_ORDER_DETAILS.TRANSACTION_DATETIME.ToString("yyyyMMddHmmss");

            var pharmacyEncodedOrder = new List <MappingEntities.drugs.PHARMACY_ENCODED_ORDER>();

            foreach (var order in entityDto.PHARMACY_ENCODED_ORDER)
            {
                var pharmacyEncorderOrderEntity = new MappingEntities.drugs.PHARMACY_ENCODED_ORDER()
                {
                    DRUG_NAME             = order.DRUG_NAME,
                    CODING_SYSTEM         = order.CODING_SYSTEM,
                    STRENGTH              = order.STRENGTH,
                    DOSAGE                = Convert.ToDecimal(order.DOSAGE),
                    FREQUENCY             = order.FREQUENCY,
                    DURATION              = order.DURATION,
                    QUANTITY_PRESCRIBED   = Convert.ToDecimal(order.QUANTITY_PRESCRIBED),
                    TREATMENT_INSTRUCTION = order.TREATMENT_INSTRUCTION,
                    PHARMACY_ORDER_DATE   = order.PHARMACY_ORDER_DATE.ToString("yyyyMMddHmmss"),
                    INDICATION            = order.INDICATION,
                    PRESCRIPTION_NOTES    = order.PRESCRIPTION_NOTES
                };

                pharmacyEncodedOrder.Add(pharmacyEncorderOrderEntity);
            }

            drugPrescriptionEntity.PHARMACY_ENCODED_ORDER = pharmacyEncodedOrder;
            return(drugPrescriptionEntity);
        }
Ejemplo n.º 3
0
        public PrescriptionSourceDto DrugPrescriptionRaised(DrugPrescriptionEntity entity)
        {
            // Patient Identification
            var internalIdentifiers = new List <INTERNAL_PATIENT_ID>();

            foreach (var identifier in entity.PATIENT_IDENTIFICATION.INTERNAL_PATIENT_ID)
            {
                var internalIdentity = new INTERNAL_PATIENT_ID()
                {
                    IDENTIFIER_TYPE = identifier.IDENTIFIER_TYPE,
                    ID = identifier.ID,
                    ASSIGNING_AUTHORITY = identifier.ASSIGNING_AUTHORITY
                };

                internalIdentifiers.Add(internalIdentity);
            }

            var pharmacyEncodedOrders = new List <PHARMACY_ENCODED_ORDER>();

            foreach (var order in entity.PHARMACY_ENCODED_ORDER)
            {
                var prescriptionOrder = new PHARMACY_ENCODED_ORDER()
                {
                    DRUG_NAME             = order.DRUG_NAME,
                    CODING_SYSTEM         = order.CODING_SYSTEM,
                    STRENGTH              = order.STRENGTH,
                    DOSAGE                = order.DOSAGE.ToString(),
                    FREQUENCY             = order.FREQUENCY,
                    DURATION              = Convert.ToInt32(order.DURATION),
                    QUANTITY_PRESCRIBED   = order.QUANTITY_PRESCRIBED.ToString(),
                    INDICATION            = order.INDICATION,
                    PHARMACY_ORDER_DATE   = Convert.ToDateTime(order.PHARMACY_ORDER_DATE),
                    TREATMENT_INSTRUCTION = order.PRESCRIPTION_NOTES
                };
                pharmacyEncodedOrders.Add(prescriptionOrder);
            }

            var patientName = new PATIENT_NAME()
            {
                FIRST_NAME  = entity.PATIENT_IDENTIFICATION.PATIENT_NAME.FIRST_NAME,
                LAST_NAME   = entity.PATIENT_IDENTIFICATION.PATIENT_NAME.LAST_NAME,
                MIDDLE_NAME = entity.PATIENT_IDENTIFICATION.PATIENT_NAME.MIDDLE_NAME
            };

            var prescriptionSourceDto = new PrescriptionSourceDto()
            {
                MESSAGE_HEADER =
                {
                    SENDING_APPLICATION   = "IQCARE",
                    SENDING_FACILITY      = entity.MESSAGE_HEADER.SENDING_FACILITY,
                    RECEIVING_APPLICATION = entity.MESSAGE_HEADER.RECEIVING_APPLICATION,
                    RECEIVING_FACILITY    = entity.MESSAGE_HEADER.RECEIVING_FACILITY,
                    MESSAGE_DATETIME      = Convert.ToDateTime(entity.MESSAGE_HEADER.MESSAGE_DATETIME), //DateTime.Now.ToString("yyyyMMddHHmmss");
                    SECURITY      = entity.MESSAGE_HEADER.SECURITY,
                    MESSAGE_TYPE  = entity.MESSAGE_HEADER.MESSAGE_TYPE,
                    PROCESSING_ID = entity.MESSAGE_HEADER.PROCESSING_ID
                },
                PATIENT_IDENTIFICATION =
                {
                    EXTERNAL_PATIENT_ID     =
                    {
                        ASSIGNING_AUTHORITY = entity.PATIENT_IDENTIFICATION.EXTERNAL_PATIENT_ID.ASSIGNING_AUTHORITY,
                        ID                  = entity.PATIENT_IDENTIFICATION.EXTERNAL_PATIENT_ID.ID,
                        IDENTIFIER_TYPE     = entity.PATIENT_IDENTIFICATION.EXTERNAL_PATIENT_ID.IDENTIFIER_TYPE
                    },
                    INTERNAL_PATIENT_ID = internalIdentifiers,
                    PATIENT_NAME        =
                    {
                        FIRST_NAME  = entity.PATIENT_IDENTIFICATION.PATIENT_NAME.FIRST_NAME,
                        MIDDLE_NAME = entity.PATIENT_IDENTIFICATION.PATIENT_NAME.MIDDLE_NAME,
                        LAST_NAME   = entity.PATIENT_IDENTIFICATION.PATIENT_NAME.LAST_NAME
                    }
                },
                COMMON_ORDER_DETAILS =
                {
                    ORDER_CONTROL       = entity.COMMON_ORDER_DETAILS.ORDER_CONTROL,
                    PLACER_ORDER_NUMBER =
                    {
                        NUMBER = entity.COMMON_ORDER_DETAILS.PLACER_ORDER_NUMBER.ToString(),
                        ENTITY = entity.COMMON_ORDER_DETAILS.PLACER_ORDER_NUMBER.ENTITY
                    },
                    ORDER_STATUS       = entity.COMMON_ORDER_DETAILS.ORDER_STATUS,
                    ORDERING_PHYSICIAN =
                    {
                        FIRST_NAME  = entity.COMMON_ORDER_DETAILS.ORDERING_PHYSICIAN.FIRST_NAME,
                        MIDDLE_NAME = entity.COMMON_ORDER_DETAILS.ORDERING_PHYSICIAN.MIDDLE_NAME,
                        LAST_NAME   = entity.COMMON_ORDER_DETAILS.ORDERING_PHYSICIAN.LAST_NAME
                    },
                    TRANSACTION_DATETIME = Convert.ToDateTime(entity.COMMON_ORDER_DETAILS.TRANSACTION_DATETIME),
                    NOTES                = entity.COMMON_ORDER_DETAILS.NOTES.ToString()
                },
                PHARMACY_ENCODED_ORDER = pharmacyEncodedOrders
            };

            return(prescriptionSourceDto);
        }