Exemplo n.º 1
0
        public void Merge(PRPA_IN201304UV02 mergeEntity)
        {
            var olds = this.Select(mergeEntity?.controlActProcess?.subject?.registrationEvent?.replacementOf?.priorRegistration?.subject1?.priorRegisteredRole?.id?.extension);

            if (olds is null)
            {
                throw new Exception("不存在 先前的注册角色");
            }

            var news = this.Select(mergeEntity?.controlActProcess?.subject?.registrationEvent?.subject1?.patient?.id.extension);

            if (news is null || news.patient_id.IsEmpty(true))
            {
                throw new Exception("不存在 病人");
            }

            var wb = new WhereBuilder();

            wb["patient_id", true] = news.patient_id;
            DBaser.Delete("IAI_PATIENT", wb);

            DBaser.Update("IAI_PATIENT");
            DBaser["patient_id"] = news.patient_id;

            wb["patient_id", true] = olds.patient_id;
            DBaser.AcceptChanges(wb);
        }
Exemplo n.º 2
0
        public override IAI_PATIENT Update(IAI_PATIENT data)
        {
            var wb = new WhereBuilder();

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

            DBaser.Update("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;
            if (DBaser.AcceptChanges(wb) <= 0)
            {
                throw new Exception("修改失敗!");
            }

            return(data.Copy());
        }
Exemplo n.º 3
0
        public override IAI_ORGANIZATION Update(PRPM_IN403010UV01 updateEntity)
        {
            var data = new IAI_ORGANIZATION
            {
                organization_id   = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.id?.extension,
                organization_code = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.code?.code,
                role_name         = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.name,
                addr               = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.addr,
                telecom            = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.telecom?.value,
                effectivetime_high = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.effectiveTime?.high?.value,
                effectivetime_low  = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.effectiveTime?.low?.value,
                name               = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.assignedPrincipalOrganization?.name,
                scoper2_id         = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.assignedEntity?.assignedPrincipalOrganization?.asAffiliate?.scoper2?.id?.extension,
                scoper2_name       = updateEntity?.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($@"未查找到结果");
            }
            DBaser.Update("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;
            var ok = DBaser.AcceptChanges(wb);

            if (ok < 1)
            {
                throw new Exception("不存在更改信息");
            }
            return(data);
        }
Exemplo n.º 4
0
        public override IAI_PROVIDER Update(PRPM_IN303010UV01 updateEntity)
        {
            var data = new IAI_PROVIDER
            {
                healthcareprovider_id   = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.id?.extension,
                healthcareprovider_code = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.code?.code,
                effectivetime_high      = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.effectiveTime?.high?.value,
                effectivetime_low       = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.effectiveTime?.low?.value,
                id_number         = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.id?.extension,
                name              = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.name?.Value,
                gender_code       = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.administrativeGenderCode?.code,
                birth_time        = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.birthTime?.value,
                birth_place       = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.birthplace?.addr,
                organization_id   = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.asAffiliate?.affiliatedPrincipalOrganization?.id?.extension,
                organization_name = updateEntity?.controlActProcess?.subject?.registrationRequest?.subject1?.healthCareProvider?.healthCarePrincipalPerson?.asAffiliate?.affiliatedPrincipalOrganization?.name,
            };

            var wb = new WhereBuilder();

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

            DBaser.Update("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;
            var ok = DBaser.AcceptChanges(wb);

            if (ok < 1)
            {
                throw new Exception("不存在更改信息");
            }
            return(data);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 更新医嘱表状态为取药预约
        /// </summary>
        /// <param name="ptno">患者编号</param>
        /// <param name="presno">处方号</param>
        public int OrderMedicationAppointment(string ptno, string presno)
        {
            if (ptno.IsEmpty())
            {
                throw new Exception("患者编号为空");
            }
            if (presno.IsEmpty())
            {
                throw new Exception(".");
            }
            var wb = new WhereBuilder();

            wb.And("PTNO", ptno, true);
            wb.And("PRESNO", presno, true);
            wb.And($@"BDATE=  TRUNC(SYSDATE)", AnalyzableKind.KeepOriginal);
            //wb.And("JUPSU", "0", true);
            DBaser.Update("TWOCS_OORDER");
            DBaser["JUPSU"] = "1";
            var count = DBaser.AcceptChanges(wb);

            //if (count <= 0)
            //    throw new Exception($"更新医嘱状态失败", new Exception($"患者编号:{ptno} 处方号:{presno}"));
            return(count);
        }