예제 #1
0
        /// <summary>
        /// 记录发药分配窗口记录
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int LogPharm(TWORD_JBINFO_180104 entity)
        {
            DBaser.Insert("TWORD_JBINFO_180104");
            DBaser["JBUSE"]     = entity.JBUSE;
            DBaser["PUMCODE"]   = entity.PUMCODE;
            DBaser["PLACECODE"] = entity.PLACECODE;
            DBaser["MINQTY"]    = entity.MINQTY;


            return(DBaser.AcceptChanges());
        }
        public override IAI_MEDICAL_REGISTRATION Insert(PRPA_IN402001UV02 addEntity)
        {
            var data = new IAI_MEDICAL_REGISTRATION()
            {
                encounterevent_id = addEntity.controlActProcess?.subject?.encounterEvent?.id?.extension,
                type_code         = addEntity.controlActProcess?.subject?.encounterEvent?.code?.code,
                effective_time    = addEntity.controlActProcess?.subject?.encounterEvent?.effectiveTime?.value,
                original_text     = addEntity.controlActProcess?.subject?.encounterEvent?.reasonCode?.originalText,
                patient_id        = addEntity.controlActProcess?.subject?.encounterEvent?.subject?.patient?.id.code,
                patient_name      = addEntity.controlActProcess?.subject?.encounterEvent?.subject?.patient?.patientPerson?.name.Value,
                consultant_id     = addEntity.controlActProcess?.subject?.encounterEvent?.admitter?.assignedPerson?.id?.extension,
                consultant_name   = addEntity.controlActProcess?.subject?.encounterEvent?.admitter?.assignedPerson?.assignedPerson?.name,
                location_id       = addEntity.controlActProcess?.subject?.encounterEvent?.location?.serviceDeliveryLocation?.location?.id?.extension,
                location_name     = addEntity.controlActProcess?.subject?.encounterEvent?.location?.serviceDeliveryLocation?.location?.name,
                organization_id   = addEntity.controlActProcess?.subject?.encounterEvent?.location?.serviceDeliveryLocation?.serviceProviderOrganization?.id?.extension,
                medical_type      = EncounterEventTypeCode.ADMITTER.Value(),
            };

            var wb = new WhereBuilder();

            wb.And("encounterevent_id", data.encounterevent_id, true);
            wb.And("medical_type", data.medical_type);

            if (DBaser.QueryValue <int>("select count(*) from IAI_MEDICAL_REGISTRATION", wb) > 0)
            {
                throw new Exception($@"主键冲突{data.consultant_id}已存在。");
            }

            DBaser.Insert("IAI_MEDICAL_REGISTRATION");
            DBaser["encounterevent_id"] = data.encounterevent_id;
            DBaser["type_code"]         = data.type_code;
            DBaser["effective_time"]    = data.effective_time;
            DBaser["original_text"]     = data.original_text;
            DBaser["patient_id"]        = data.patient_id;
            DBaser["patient_name"]      = data.patient_name;
            DBaser["consultant_id"]     = data.consultant_id;
            DBaser["consultant_name"]   = data.consultant_name;
            DBaser["location_id"]       = data.location_id;
            DBaser["location_name"]     = data.location_name;
            DBaser["organization_id"]   = data.organization_id;
            DBaser["medical_type"]      = data.medical_type;



            DBaser.AcceptChanges();
            return(data);
        }
        public override IAI_MEDICAL_REGISTRATION Insert(PRPA_IN402003UV02 item)
        {
            var data = new IAI_MEDICAL_REGISTRATION()
            {
                encounterevent_id = item.controlActProcess?.subject?.encounterEvent?.id?.extension,
                type_code         = item.controlActProcess?.subject?.encounterEvent?.code?.code,
                effective_time    = item.controlActProcess?.subject?.encounterEvent?.effectiveTime?.value,
                original_text     = item.controlActProcess?.subject?.encounterEvent?.dischargeDispositionCode.code,
                patient_id        = item.controlActProcess?.subject?.encounterEvent?.subject?.patient?.id.code,
                patient_name      = item.controlActProcess?.subject?.encounterEvent?.subject?.patient?.patientPerson?.name.Value,
                consultant_id     = item.controlActProcess?.subject?.encounterEvent?.discharger?.assignedPerson?.id?.extension,
                consultant_name   = item.controlActProcess?.subject?.encounterEvent?.discharger?.assignedPerson?.assignedPerson?.name?.Value,
                medical_type      = (int)EncounterEventTypeCode.DISCHARGE,
            };

            var wb = new WhereBuilder();

            wb.And("encounterevent_id", data.encounterevent_id);
            wb.And("medical_type", data.medical_type);

            var sql = $@"
Select      *
From        IAI_MEDICAL_REGISTRATION
";

            if (DBaser.QueryValue <int>("Select count(*) From IAI_MEDICAL_REGISTRATION", wb) > 0)
            {
                throw new Exception($@"主键冲突{data.encounterevent_id}已存在。");
            }

            DBaser.Insert("IAI_MEDICAL_REGISTRATION");
            DBaser["encounterevent_id"] = data.encounterevent_id;
            DBaser["type_code"]         = data.type_code;
            DBaser["effective_time"]    = data.effective_time;
            DBaser["original_text"]     = data.original_text;
            DBaser["patient_id"]        = data.patient_id;
            DBaser["patient_name"]      = data.patient_name;
            DBaser["consultant_id"]     = data.consultant_id;
            DBaser["consultant_name"]   = data.consultant_name;
            DBaser["medical_type"]      = data.medical_type;
            DBaser.AcceptChanges();

            return(data);
        }
예제 #4
0
        public override IAI_PROVIDER Insert(PRPM_IN301010UV01 addEntity)
        {
            var data = new IAI_PROVIDER
            {
                healthcareprovider_id   = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.id?.extension,
                healthcareprovider_code = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.code?.code,
                effectivetime_high      = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.effectiveTime?.high?.value,
                effectivetime_low       = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.effectiveTime?.low?.value,
                id_number         = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.id?.extension,
                name              = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.name?.Value,
                gender_code       = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.administrativeGenderCode?.code,
                birth_time        = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.birthTime?.value,
                birth_place       = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.birthplace?.addr,
                organization_id   = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.asAffiliate?.affiliatedPrincipalOrganization?.id?.extension,
                organization_name = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.asAffiliate?.affiliatedPrincipalOrganization?.name,
            };

            var wb = new WhereBuilder();

            wb.And("healthcareprovider_id", data?.healthcareprovider_id, true);

            if (DBaser.QueryValue <int>("select count(*) from IAI_PROVIDER", wb) > 0)
            {
                throw new Exception($@"主键冲突{data.healthcareprovider_id}已存在。");
            }

            DBaser.Insert("IAI_PROVIDER");
            DBaser["healthcareprovider_id"]   = data.healthcareprovider_id;
            DBaser["healthcareprovider_code"] = data.healthcareprovider_code;
            DBaser["effectivetime_high"]      = data.effectivetime_high;
            DBaser["effectivetime_low"]       = data.effectivetime_low;
            DBaser["id_number"]         = data.id_number;
            DBaser["name"]              = data.name;
            DBaser["gender_code"]       = data.gender_code;
            DBaser["birth_time"]        = data.birth_time;
            DBaser["birth_place"]       = data.birth_place;
            DBaser["organization_id"]   = data.organization_id;
            DBaser["organization_name"] = data.organization_name;
            DBaser.AcceptChanges();

            return(data);
        }
예제 #5
0
 /// <summary>
 /// 报道登记
 /// </summary>
 public int InPatientSignIn(TWOCS_PRSLIP_CHECK orderInfo, InPatientCheck ptInfo)
 {
     DBaser.Insert("TWOCS_PRSLIP_CHECK");
     DBaser["GBIO"]       = orderInfo.GBIO;
     DBaser["PTNO"]       = ptInfo.PTNO;
     DBaser["BI"]         = orderInfo.BI;
     DBaser["DEPTCODE"]   = ptInfo.DEPTCODE;
     DBaser["DRCODE"]     = ptInfo.DRCODE;
     DBaser["WARDCODE"]   = ptInfo.WARDCODE;
     DBaser["ROOMCODE"]   = orderInfo.ROOMCODE;
     DBaser["ORDERGUBUN"] = orderInfo.ORDERGUBUN;
     DBaser["ORDERCODE"]  = orderInfo.ORDERCODE;
     DBaser["SENDDEPT1"]  = orderInfo.SENDDEPT1;
     DBaser["BDATE"]      = orderInfo.BDATE;
     DBaser["SUCODE"]     = orderInfo.SUCODE;
     DBaser["BUN"]        = orderInfo.BUN;
     DBaser["SLIPNO"]     = orderInfo.SLIPNO;
     DBaser["QTY"]        = orderInfo.QTY;
     DBaser["NAL"]        = orderInfo.NAL;
     DBaser["DIV"]        = orderInfo.DIV;
     DBaser["REALQTY"]    = orderInfo.REALQTY;
     DBaser["DOSCODE"]    = orderInfo.DOSCODE;
     DBaser["GRP"]        = orderInfo.GRP;
     DBaser["REMARK"]     = orderInfo.REMARK;
     //DBaser["STATUS"] = orderInfo.STATUS;
     DBaser["ORDERNO"]   = orderInfo.ORDERNO;
     DBaser["CHUANGKOU"] = orderInfo.CHUANGKOU;
     DBaser["PUMCODE"]   = orderInfo.PUMCODE;
     //DBaser["PRESNO"] = orderInfo.PRESNO;
     DBaser["CHECKDATE"] = Environ.SlowTime.Date;              // orderInfo.CHECKDATE;
     DBaser["FLAG"]      = orderInfo.FLAG;
     DBaser["CHECKTIME"] = Environ.SlowTime.ToString("HH:mm"); // orderInfo.CHECKTIME;
     //DBaser["OUTUSER"] = orderInfo.OUTUSER;
     //DBaser["OUTDATE"] = orderInfo.OUTDATE;
     //DBaser["OUTTIME"] = orderInfo.OUTTIME;
     //DBaser["REUSER"] = orderInfo.REUSER;
     //DBaser["REDATE"] = orderInfo.REDATE;
     //DBaser["RETIME"] = orderInfo.RETIME;
     //DBaser["HOSPITALIZEDUID"] = orderInfo.HOSPITALIZEDUID;
     return(DBaser.AcceptChanges());
 }
예제 #6
0
        public override IAI_ORGANIZATION Insert(PRPM_IN401030UV01 addEntity)
        {
            var data = new IAI_ORGANIZATION
            {
                organization_id   = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.id?.extension,
                organization_code = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.code?.code,
                role_name         = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.name,
                addr               = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.addr,
                telecom            = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.telecom?.value,
                effectivetime_high = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.effectiveTime?.high?.value,
                effectivetime_low  = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.effectiveTime?.low?.value,
                name               = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.assignedPrincipalOrganization?.name,
                scoper2_id         = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.assignedPrincipalOrganization?.asAffiliate?.scoper2?.id?.extension,
                scoper2_name       = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.assignedPrincipalOrganization?.asAffiliate?.scoper2?.name,
            };


            var wb = new WhereBuilder();

            wb.And("organization_id", data.organization_id, true);

            if (DBaser.QueryValue <int>("select count(*) from IAI_ORGANIZATION", wb) > 0)
            {
                throw new Exception($@"主键冲突{data.organization_id}已存在。");
            }
            DBaser.Insert("IAI_ORGANIZATION");
            DBaser["organization_id"]   = data.organization_id;
            DBaser["organization_code"] = data.organization_code;
            DBaser["role_name"]         = data.role_name;
            DBaser["addr"]               = data.addr;
            DBaser["telecom"]            = data.telecom;
            DBaser["effectivetime_high"] = data.effectivetime_high;
            DBaser["effectivetime_low"]  = data.effectivetime_low;
            DBaser["name"]               = data.name;
            DBaser["scoper2_id"]         = data.scoper2_id;
            DBaser["scoper2_name"]       = data.scoper2_name;
            DBaser.AcceptChanges();
            return(data);
        }
예제 #7
0
        public override IAI_PATIENT Insert(PRPA_IN201311UV02 addEntity)
        {
            var asOtherIDs = addEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.asOtherIDs;
            var data       = new IAI_PATIENT()
            {
                patient_id                   = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.id?.extension,
                id_number                    = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.id?.extension,
                name                         = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.name?.Value,
                telecom                      = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.telecom?.value,
                gender_code                  = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.administrativeGenderCode?.code,
                birth_time                   = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.birthTime?.value,
                street_address_line          = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.addr?.streetAddressLine?.Value,
                state                        = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.addr?.state?.Value,
                city                         = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.addr?.city,
                county                       = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.addr?.county,
                street_name_base             = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.addr?.streetNameBase,
                street_name                  = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.addr?.streetName,
                house_number                 = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.addr?.houseNumber,
                postal_code                  = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.addr?.postalCode,
                marital_status_code          = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.maritalStatusCode?.code,
                ethnic_group_code            = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.ethnicGroupCode?.code,
                occupation_code              = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.asEmployee?.occupationCode?.code,
                employerorganization_name    = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.asEmployee?.employerOrganization?.name,
                employerorganization_telecom = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.asEmployee?.employerOrganization?.contactParty?.telecom?.value,
                asotherids_id1               = asOtherIDs?.Length >= 1 ? asOtherIDs[0]?.id?.extension : "",
                scopingorganization_id1      = asOtherIDs?.Length >= 1 ? asOtherIDs[0]?.scopingOrganization?.id?.extension : "",
                asotherids_id2               = asOtherIDs?.Length >= 2 ? asOtherIDs[1]?.id?.extension : "",
                scopingorganization_id2      = asOtherIDs?.Length >= 2 ? asOtherIDs[1]?.scopingOrganization?.id?.extension : "",
                personalrelationship_code    = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.personalRelationship?.code,
                personalrelationship_telecom = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.personalRelationship?.telecom?.value,
                relationshipholder1_name     = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.patientPerson?.personalRelationship?.relationshipHolder1?.name,
                providerorganization_id      = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.providerOrganization?.id?.extension,
                providerorganization_name    = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.providerOrganization?.name?.Value,
                beneficiary_code             = addEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.patient?.coveredPartyOf?.coverageRecord?.beneficiary?.beneficiary?.code?.code,
            };

            var wb = new WhereBuilder();

            wb.And("patient_id", data?.patient_id, true);

            if (DBaser.QueryValue <int>("select count(*) from IAI_PATIENT", wb) > 0)
            {
                throw new Exception($@"主键冲突{data.patient_id}已存在。");
            }

            DBaser.Insert("IAI_PATIENT");
            DBaser["patient_id"]                   = data.patient_id;
            DBaser["id_number"]                    = data.id_number;
            DBaser["name"]                         = data.name;
            DBaser["telecom"]                      = data.telecom;
            DBaser["gender_code"]                  = data.gender_code;
            DBaser["birth_time"]                   = data.birth_time;
            DBaser["street_address_line"]          = data.street_address_line;
            DBaser["state"]                        = data.state;
            DBaser["city"]                         = data.city;
            DBaser["county"]                       = data.county;
            DBaser["street_name_base"]             = data.street_name_base;
            DBaser["street_name"]                  = data.street_name;
            DBaser["house_number"]                 = data.house_number;
            DBaser["postal_code"]                  = data.postal_code;
            DBaser["marital_status_code"]          = data.marital_status_code;
            DBaser["ethnic_group_code"]            = data.ethnic_group_code;
            DBaser["occupation_code"]              = data.occupation_code;
            DBaser["employerorganization_name"]    = data.employerorganization_name;
            DBaser["employerorganization_telecom"] = data.employerorganization_telecom;
            DBaser["asotherids_id1"]               = data.asotherids_id1;
            DBaser["scopingorganization_id1"]      = data.scopingorganization_id1;
            DBaser["asotherids_id2"]               = data.asotherids_id2;
            DBaser["scopingorganization_id2"]      = data.scopingorganization_id2;
            DBaser["personalrelationship_code"]    = data.personalrelationship_code;
            DBaser["personalrelationship_telecom"] = data.personalrelationship_telecom;
            DBaser["relationshipholder1_name"]     = data.relationshipholder1_name;
            DBaser["providerorganization_id"]      = data.providerorganization_id;
            DBaser["providerorganization_name"]    = data.providerorganization_name;
            DBaser["beneficiary_code"]             = data.beneficiary_code;
            DBaser.AcceptChanges();

            return(data);
        }
예제 #8
0
        public void Add(PRPA_IN201311UV02 requestEntity)
        {
            #region 临时方案
            //try
            //{
            //    var data = new TWBAS_PATIENT()
            //    {
            //        PTNO = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.id.extension,
            //        SNAME = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.name.Value,
            //        SEX = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.administrativeGenderCode.code,
            //        BIRTHDATE = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.birthTime.DateTime.Value,
            //        JUMIN = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.id.extension,
            //        //DBaser["STARTDATE"] = "";
            //        //DBaser["LASTDATE"] = "";
            //        POSTCODE = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.addr.postalCode,
            //        JUSO = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.addr.streetAddressLine.Value,
            //        //DBaser["JIYUKCODE"] = "";
            //        TEL = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.telecom.value,
            //        //DBaser["TEL1"] = "";
            //        CPNO = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.asOtherIDs.ToList().FirstOrDefault()?.id?.extension.SubString(14),
            //        //DBaser["SABUN"] = "";
            //        //DBaser["EMBPRT"] = "";
            //        //DBaser["BI"] = "";
            //        //DBaser["PNAME"] = "";
            //        //DBaser["GBGWANGE"] = "";
            //        //DBaser["KIHO"] = "";
            //        //DBaser["GKIHO"] = "";
            //        //DBaser["GBAREA"] = "";
            //        //DBaser["AREADATE"] = "";
            //        //DBaser["KIDNEYOPDATE"] = "";
            //        //DBaser["CHECKFLAG"] = "";
            //        //DBaser["CHECKREMARK"] = "";
            //        //DBaser["GBBOHUN"] = "";
            //        DEPTCODE = "",
            //        //DBaser["DRCODE"] = "";
            //        //DBaser["GBSPC"] = "";
            //        //DBaser["GBGAMEK"] = "";
            //        //DBaser["GBBUNUP"] = "";
            //        //DBaser["REMARK"] = "";
            //        //DBaser["JINILSU"] = "";
            //        //DBaser["JINAMT"] = "";
            //        //DBaser["TUYAKGWA"] = "";
            //        //DBaser["TUYAKMONTH"] = "";
            //        //DBaser["TUYAKJULDATE"] = "";
            //        //DBaser["TUYAKILSU"] = "";
            //        //DBaser["CONSULT"] = "";
            //        //DBaser["RELIGION"] = "";
            //        //DBaser["GYOGUCODE"] = "";
            //        MARRIAGE = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.maritalStatusCode.code.SubString(1),
            //        PEOPLE = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.ethnicGroupCode.code,
            //        //DBaser["NATIONAL"] = "";
            //        JOB = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.asEmployee.occupationCode.code,
            //        //DBaser["JOBPOST"] = "";
            //        //DBaser["JOBADDRESS"] = t.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.asEmployee.employerOrganization.name;
            //        JOBTEL = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.asEmployee.employerOrganization.contactParty.telecom.value,
            //        JOBNAME = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.asEmployee.employerOrganization.name,
            //        //DBaser["BIRTHPLACE"] = ""requestEntity.;
            //        GKIHO2 = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.asOtherIDs.ToList().FirstOrDefault()?.id?.extension,
            //        //DBaser["BANNO"] = "";
            //        //DBaser["CARDID"] = "";
            //        IDNUMBER = "",// t.controlActProcess.subject.registrationRequest.author.assignedEntity.id.extension.SubString(6),
            //        INSERTID = "",
            //        INSERTDATE = DateTime.Now,
            //    };
            //    Instance.db.Insertable(data).ExecuteCommand();
            //}
            //catch (Exception)
            //{

            //    throw;
            //}
            #endregion

            #region 新框架 DBaser 为null  待解决
            try
            {
                DBaser.Insert("TWBAS_PATIENT");
                DBaser["PTNO"]      = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.id.extension;
                DBaser["SNAME"]     = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.name.Value;
                DBaser["SEX"]       = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.administrativeGenderCode.code;
                DBaser["BIRTHDATE"] = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.birthTime.value;
                DBaser["JUMIN"]     = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.id.extension;
                //DBaser["STARTDATE"] = "";
                //DBaser["LASTDATE"] = "";
                DBaser["POSTCODE"] = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.addr.postalCode;
                DBaser["JUSO"]     = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.addr.streetAddressLine.Value.PadRight(60, ' ').Substring(0, 60);
                //DBaser["JIYUKCODE"] = "";
                DBaser["TEL"] = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.telecom.value;
                //DBaser["TEL1"] = "";
                DBaser["CPNO"] = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.asOtherIDs.ToList().FirstOrDefault()?.id?.extension;
                //DBaser["SABUN"] = "";
                //DBaser["EMBPRT"] = "";
                //DBaser["BI"] = "";
                //DBaser["PNAME"] = "";
                //DBaser["GBGWANGE"] = "";
                //DBaser["KIHO"] = "";
                //DBaser["GKIHO"] = "";
                //DBaser["GBAREA"] = "";
                //DBaser["AREADATE"] = "";
                //DBaser["KIDNEYOPDATE"] = "";
                //DBaser["CHECKFLAG"] = "";
                //DBaser["CHECKREMARK"] = "";
                //DBaser["GBBOHUN"] = "";
                DBaser["DEPTCODE"] = "";
                //DBaser["DRCODE"] = "";
                //DBaser["GBSPC"] = "";
                //DBaser["GBGAMEK"] = "";
                //DBaser["GBBUNUP"] = "";
                //DBaser["REMARK"] = "";
                //DBaser["JINILSU"] = "";
                //DBaser["JINAMT"] = "";
                //DBaser["TUYAKGWA"] = "";
                //DBaser["TUYAKMONTH"] = "";
                //DBaser["TUYAKJULDATE"] = "";
                //DBaser["TUYAKILSU"] = "";
                //DBaser["CONSULT"] = "";
                //DBaser["RELIGION"] = "";
                //DBaser["GYOGUCODE"] = "";
                DBaser["MARRIAGE"] = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.maritalStatusCode.code;
                DBaser["PEOPLE"]   = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.ethnicGroupCode.code;
                //DBaser["NATIONAL"] = "";
                DBaser["JOB"] = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.asEmployee.occupationCode.code;
                //DBaser["JOBPOST"] = "";
                //DBaser["JOBADDRESS"] = t.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.asEmployee.employerOrganization.name;
                DBaser["JOBTEL"]  = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.asEmployee.employerOrganization.contactParty.telecom.value;
                DBaser["JOBNAME"] = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.asEmployee.employerOrganization.name;
                //DBaser["BIRTHPLACE"] = "";
                DBaser["GKIHO2"] = requestEntity.controlActProcess.subject.registrationRequest.subject1.patient.patientPerson.asOtherIDs.ToList().FirstOrDefault()?.id?.extension;
                //DBaser["BANNO"] = "";
                //DBaser["CARDID"] = "";
                DBaser["IDNUMBER"]   = requestEntity.controlActProcess.subject.registrationRequest.author.assignedEntity.id.extension;
                DBaser["INSERTID"]   = "";
                DBaser["INSERTDATE"] = DateTime.Now;
                DBaser.AcceptChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            #endregion
        }
예제 #9
0
        public override IAI_OBSERVATION Insert(POOR_IN200901UV addEntity)
        {
            var data = new IAI_OBSERVATION
            {
                observation_id           = addEntity?.controlActProcess?.subject?.observationRequest?.id?.extension,
                observation_type         = addEntity?.controlActProcess?.subject?.observationRequest?.code,
                observation_text         = addEntity?.controlActProcess?.subject?.observationRequest?.text,
                effectivetime_high       = addEntity.controlActProcess?.subject?.observationRequest?.effectiveTime?.high?.value,
                effectivetime_low        = addEntity.controlActProcess?.subject?.observationRequest?.effectiveTime?.low?.value,
                prioritycode             = addEntity?.controlActProcess?.subject?.observationRequest?.priorityCode?.code,
                specimen_id              = addEntity?.controlActProcess?.subject?.observationRequest?.specimen?.specimen?.id.extension,
                specimen_code            = addEntity?.controlActProcess?.subject?.observationRequest?.specimen?.specimen?.code,
                specimen_desc            = addEntity?.controlActProcess?.subject?.observationRequest?.specimen?.specimen?.specimenNatural.desc,
                additive3                = addEntity?.controlActProcess?.subject?.observationRequest?.specimen?.specimen?.specimenNatural?.additive?.additive3?.desc?.Value,
                productOf_time           = addEntity?.controlActProcess?.subject?.observationRequest?.specimen?.specimen?.productOf.time.value,
                specimenProcessStep_time = addEntity?.controlActProcess?.subject?.observationRequest?.specimen?.specimen?.productOf?.specimenProcessStep?.effectiveTime?.value,


                recordtarget                 = addEntity?.controlActProcess?.subject?.observationRequest?.recordTarget?.patient?.id[0].extension,
                author_time                  = addEntity?.controlActProcess?.subject?.observationRequest?.author?.time.value,
                signaturetext                = addEntity?.controlActProcess?.subject?.observationRequest?.author?.signatureText,
                author_assignedentity_id     = addEntity?.controlActProcess?.subject?.observationRequest?.author?.assignedEntity?.id.extension,
                assignedperson_name          = addEntity?.controlActProcess?.subject?.observationRequest?.author?.assignedEntity?.assignedPerson?.name.Value,
                representedorganization_id   = addEntity?.controlActProcess?.subject?.observationRequest?.author?.assignedEntity?.representedOrganization?.id.extension,
                representedorganization_name = addEntity?.controlActProcess?.subject?.observationRequest?.author?.assignedEntity?.representedOrganization?.name,
                verifier_time                = addEntity?.controlActProcess?.subject?.observationRequest?.verifier?.time.value,
                verifier_signaturetext       = addEntity?.controlActProcess?.subject?.observationRequest?.verifier?.signatureText,
                verifier_assignedentity_id   = addEntity?.controlActProcess?.subject?.observationRequest?.verifier?.assignedEntity?.id.extension,
                verifier_assignedperson_name = addEntity?.controlActProcess?.subject?.observationRequest?.verifier?.assignedEntity?.assignedPerson?.name.Value,
                goal_text                     = addEntity?.controlActProcess?.subject?.observationRequest?.goal?.observationEventCriterion?.text,
                goal_reason                   = addEntity?.controlActProcess?.subject?.observationRequest?.reason[0].observation.value.Value,
                annotation_text               = addEntity?.controlActProcess?.subject?.observationRequest?.subjectOf6?.annotation?.text,
                annotation_author_id          = addEntity?.controlActProcess?.subject?.observationRequest?.subjectOf6?.annotation?.author?.assignedEntity?.id.extension,
                annotation_author_name        = addEntity?.controlActProcess?.subject?.observationRequest?.subjectOf6?.annotation?.author?.assignedEntity?.assignedPerson?.name.Value,
                represented_organization_id   = addEntity?.controlActProcess?.subject?.observationRequest?.subjectOf6?.annotation?.author?.assignedEntity?.representedOrganization?.id.extension,
                represented_organization_name = addEntity?.controlActProcess?.subject?.observationRequest?.subjectOf6?.annotation?.author?.assignedEntity?.representedOrganization?.name,

                encounter_id = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.componentOf1?.encounter?.id,
            };


            var wb = new WhereBuilder();

            wb.And("observation_id", data.observation_id, true);
            if (DBaser.QueryValue <int>("select count(*) from IAI_OBSERVATION", wb) > 0)
            {
                throw new Exception($@"主键冲突{data.observation_id}已存在。");
            }
            DBaser.Insert("IAI_OBSERVATION");
            DBaser["observation_id"]                = data.observation_id;
            DBaser["observation_type"]              = data.observation_type;
            DBaser["observation_text"]              = data.observation_text;
            DBaser["effectivetime_high"]            = data.effectivetime_high;
            DBaser["effectivetime_low"]             = data.effectivetime_low;
            DBaser["prioritycode"]                  = data.prioritycode;
            DBaser["specimen_id"]                   = data.specimen_id;
            DBaser["specimen_code"]                 = data.specimen_code;
            DBaser["specimen_desc"]                 = data.specimen_desc;
            DBaser["additive3"]                     = data.additive3;
            DBaser["productOf_time"]                = data.productOf_time;
            DBaser["specimenProcessStep_time"]      = data.specimenProcessStep_time;
            DBaser["recordtarget"]                  = data.recordtarget;
            DBaser["author_time"]                   = data.author_time;
            DBaser["signaturetext"]                 = data.signaturetext;
            DBaser["author_assignedentity_id"]      = data.author_assignedentity_id;
            DBaser["assignedperson_name"]           = data.assignedperson_name;
            DBaser["representedorganization_id"]    = data.representedorganization_id;
            DBaser["representedorganization_name"]  = data.representedorganization_name;
            DBaser["verifier_time"]                 = data.verifier_time;
            DBaser["verifier_signaturetext"]        = data.verifier_signaturetext;
            DBaser["verifier_assignedentity_id"]    = data.verifier_assignedentity_id;
            DBaser["verifier_assignedperson_name"]  = data.verifier_assignedperson_name;
            DBaser["goal_text"]                     = data.goal_text;
            DBaser["goal_reason"]                   = data.goal_reason;
            DBaser["annotation_text"]               = data.annotation_text;
            DBaser["annotation_author_id"]          = data.annotation_author_id;
            DBaser["annotation_author_name"]        = data.annotation_author_name;
            DBaser["represented_organization_id"]   = data.represented_organization_id;
            DBaser["represented_organization_name"] = data.represented_organization_name;
            DBaser.AcceptChanges();
            return(data);
        }
예제 #10
0
        public override IAI_ORDER Insert(POOR_IN200901UV addEntity)
        {
            string _effectivetime_high = "", _effectivetime_low = "", _effectivetime_period = "", _effectivetime_unit = "";

            if (addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.effectiveTime.Count() >= 1)
            {
                _effectivetime_high = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.effectiveTime[0]?.high?.value;
                _effectivetime_low  = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.effectiveTime[0]?.low?.value;
            }
            if (addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.effectiveTime.Count() >= 2)
            {
                _effectivetime_period = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.effectiveTime[1]?.period?.value;
                _effectivetime_unit   = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.effectiveTime[1]?.period?.unit;
            }
            var data = new IAI_ORDER
            {
                order_id                     = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.id?.extension,
                order_type_code              = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.code?.code,
                text                         = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.text,
                effectivetime_high           = _effectivetime_high,   // addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.effectiveTime[0]?.high?.value,
                effectivetime_low            = _effectivetime_low,    //addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.effectiveTime[0]?.low?.value,
                effectivetime_period         = _effectivetime_period, //addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.effectiveTime[1]?.period?.value,
                effectivetime_unit           = _effectivetime_unit,   // addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.effectiveTime[1]?.period?.unit,
                route_code                   = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.routeCode?.code,
                dose_quantity                = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.doseQuantity?.value,
                dose_quantity_unit           = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.doseQuantity?.unit,
                numertor                     = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.doseCheckQuantity?.numerator?.value,
                denominator                  = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.doseCheckQuantity?.denominator?.value,
                unit_code                    = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.administrationUnitCode?.code,
                medicine_name                = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.consumable2?.medication1?.administerableMedicine?.name,
                capacity_quantity            = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.consumable2?.medication1?.administerableMedicine?.asContent?.containerPackagedMedicine?.capacityQuantity?.value,
                patient_id                   = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.componentOf1?.encounter?.subject?.patient?.patientPerson?.id?.extension,
                author_time                  = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.author?.time?.value,
                signature_text               = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.author?.signatureText,
                assignedentity_id            = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.author?.assignedEntity?.id.extension,
                assignedperson_name          = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.author?.assignedEntity?.assignedPerson?.name?.Value,
                organization_id              = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.author?.assignedEntity?.representedOrganization?.id?.extension,
                organization_name            = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.author?.assignedEntity?.representedOrganization?.name,
                verifier_time                = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.verifier?.time?.value,
                verifier_assignedentity_id   = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.verifier?.assignedEntity?.id?.extension,
                verifier_assignedentity_name = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.verifier?.assignedEntity?.assignedPerson?.name?.Value,
                annotion_text                = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.subjectOf6?.annotation?.text,
                annotion_status_code         = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.subjectOf6?.annotation?.statusCode.code,
                annotion_author_id           = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.subjectOf6?.annotation?.author?.assignedEntity?.id?.extension,
                annotion_author_name         = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.subjectOf6?.annotation?.author?.assignedEntity?.assignedPerson?.name?.Value,
                annotion_organization_id     = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.subjectOf6?.annotation?.author?.assignedEntity?.representedOrganization?.id?.extension,
                annotion_organization_name   = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.subjectOf6?.annotation?.author?.assignedEntity?.representedOrganization?.name,
                encounter_id                 = addEntity.controlActProcess?.subject?.substanceAdministrationRequest?.componentOf1?.encounter?.id,
            };


            var wb = new WhereBuilder();

            wb.And("order_id", data.order_id, true);
            if (DBaser.QueryValue <int>("select count(*) from IAI_ORDER", wb) > 0)
            {
                throw new Exception($@"主键冲突{data.order_id}已存在。");
            }
            DBaser.Insert("IAI_ORDER");
            DBaser["order_id"]             = data.order_id;
            DBaser["order_type_code"]      = data.order_type_code;
            DBaser["text"]                 = data.text;
            DBaser["effectivetime_high"]   = data.effectivetime_high;
            DBaser["effectivetime_low"]    = data.effectivetime_low;
            DBaser["effectivetime_period"] = data.effectivetime_period;
            DBaser["effectivetime_unit"]   = data.effectivetime_unit;
            DBaser["route_code"]           = data.route_code;
            DBaser["dose_quantity"]        = data.dose_quantity;
            DBaser["dose_quantity_unit"]   = data.dose_quantity_unit;
            DBaser["numertor"]             = data.numertor;
            DBaser["denominator"]          = data.denominator;
            DBaser["unit_code"]            = data.unit_code;
            DBaser["medicine_name"]        = data.medicine_name;
            DBaser["capacity_quantity"]    = data.capacity_quantity;
            DBaser["patient_id"]           = data.patient_id;
            DBaser["author_time"]          = data.author_time;


            DBaser["signature_text"] = data.signature_text;

            DBaser["assignedentity_id"]   = data.assignedentity_id;
            DBaser["assignedperson_name"] = data.assignedperson_name;
            DBaser["organization_id"]     = data.organization_id;

            DBaser["organization_name"] = data.organization_name;
            DBaser["verifier_time"]     = data.verifier_time;

            DBaser["verifier_assignedentity_id"]   = data.verifier_assignedentity_id;
            DBaser["verifier_assignedentity_name"] = data.verifier_assignedentity_name;
            DBaser["annotion_text"]              = data.annotion_text;
            DBaser["annotion_status_code"]       = data.annotion_status_code;
            DBaser["annotion_author_id"]         = data.annotion_author_id;
            DBaser["annotion_author_name"]       = data.annotion_author_name;
            DBaser["annotion_organization_id"]   = data.annotion_organization_id;
            DBaser["annotion_organization_name"] = data.annotion_organization_name;
            DBaser["encounter_id"] = data.encounter_id;
            DBaser.AcceptChanges();
            return(data);
        }