public HospitalizationComponent GetHospitalizationDetails(entitystorematerialised_CoreEncounter coreEncounter)
        {
            var hospitalization = new HospitalizationComponent();

            if (coreEncounter.IsNull())
            {
                return(hospitalization);
            }

            hospitalization.AdmitSource = new CodeableConcept();

            hospitalization.DischargeDisposition = new CodeableConcept();

            hospitalization.AdmitSource.Text = coreEncounter.Referringdoctortext;

            Coding admitSourceCode = new Coding
            {
                Code = coreEncounter.Referringdoctorid
            };

            hospitalization.AdmitSource.Coding.Add(admitSourceCode);

            hospitalization.DischargeDisposition.Text = coreEncounter.Dischargetext;

            Coding dischargeCode = new Coding();

            dischargeCode.Code = coreEncounter.Dischargecode;

            hospitalization.DischargeDisposition.Coding.Add(dischargeCode);

            return(hospitalization);
        }
        private Meta GetMeta(entitystorematerialised_CoreEncounter src)
        {
            if (src.IsNull() || !src.Createdtimestamp.HasValue)
            {
                return(null);
            }

            return(new Meta
            {
                VersionId = $"{src.Sequenceid}",
                LastUpdated = src.Createdtimestamp
            });
        }
        public Period GetEncounterPeriod(entitystorematerialised_CoreEncounter coreEncounter)
        {
            var period = new Period();

            if (coreEncounter.IsNull())
            {
                return(period);
            }

            period.Start = Convert.ToString(coreEncounter.Admitdatetime);
            period.End   = Convert.ToString(coreEncounter.Dischargedatetime);

            return(period);
        }
        private List <Identifier> GetEncounterIdentifiers(entitystorematerialised_CoreEncounter coreEncounter)
        {
            var identifiers = new List <Identifier>();

            if (coreEncounter.IsNull())
            {
                return(identifiers);
            }

            Identifier id = new Identifier
            {
                Value = coreEncounter.Visitnumber
            };

            identifiers.Add(id);

            return(identifiers);
        }
        public List <CodeableConcept> GetReasonCodes(entitystorematerialised_CoreEncounter coreEncounter)
        {
            var reasonCodes = new List <CodeableConcept>();

            if (coreEncounter.IsNull())
            {
                return(reasonCodes);
            }

            CodeableConcept reasonCode = new CodeableConcept();

            reasonCode.Text = coreEncounter.Admitreasontext;

            Coding coding = new Coding
            {
                Code = coreEncounter.Admitreasoncode
            };

            reasonCode.Coding.Add(coding);

            return(reasonCodes);
        }