示例#1
0
 def build_contract_agent(cls, contract, imis_coverage):
     agent = ContractAgent()
     actor = PractitionerConverter.build_fhir_resource_reference(
         imis_coverage.officer)
     agent.actor = actor
     provider_role = cls.build_simple_codeable_concept(
         Stu3CoverageConfig.get_practitioner_role_code())
     agent.role = [provider_role]
     contract.agent = [agent]
 def create_test_fhir_instance(self):
     fhir_claim = FHIRClaim()
     fhir_claim.id = self._TEST_CODE
     fhir_claim.patient = PatientConverter.build_fhir_resource_reference(
         self._TEST_INSUREE)
     claim_code = ClaimConverter.build_fhir_identifier(
         self._TEST_CODE,
         Stu3IdentifierConfig.get_fhir_identifier_type_system(),
         Stu3IdentifierConfig.get_fhir_claim_code_type())
     fhir_claim.identifier = [claim_code]
     billable_period = Period()
     billable_period.start = self._TEST_DATE_FROM
     billable_period.end = self._TEST_DATE_TO
     fhir_claim.billablePeriod = billable_period
     diagnoses = []
     ClaimConverter.build_fhir_diagnosis(diagnoses,
                                         self._TEST_DIAGNOSIS_CODE.code,
                                         ImisClaimIcdTypes.ICD_0.value)
     fhir_claim.diagnosis = diagnoses
     total = Money()
     total.value = self._TEST_CLAIMED
     fhir_claim.total = total
     fhir_claim.created = self._TEST_DATE_CLAIMED
     fhir_claim.facility = LocationConverter.build_fhir_resource_reference(
         self._TEST_HF)
     information = []
     guarantee_id_code = Stu3ClaimConfig.get_fhir_claim_information_guarantee_id_code(
     )
     ClaimConverter.build_fhir_string_information(information,
                                                  guarantee_id_code,
                                                  self._TEST_GUARANTEE_ID)
     explanation_code = Stu3ClaimConfig.get_fhir_claim_information_explanation_code(
     )
     ClaimConverter.build_fhir_string_information(information,
                                                  explanation_code,
                                                  self._TEST_EXPLANATION)
     fhir_claim.information = information
     fhir_claim.enterer = PractitionerConverter.build_fhir_resource_reference(
         self._TEST_CLAIM_ADMIN)
     fhir_claim.type = ClaimConverter.build_simple_codeable_concept(
         self._TEST_VISIT_TYPE)
     type = Stu3ClaimConfig.get_fhir_claim_item_code()
     ClaimConverter.build_fhir_item(fhir_claim, self._TEST_ITEM_CODE, type,
                                    self._TEST_ITEM)
     type = Stu3ClaimConfig.get_fhir_claim_service_code()
     ClaimConverter.build_fhir_item(fhir_claim, self._TEST_SERVICE_CODE,
                                    type, self._TEST_SERVICE)
     return fhir_claim
 def to_fhir_obj(cls, imis_claim):
     fhir_claim = FHIRClaim()
     cls.build_fhir_pk(fhir_claim, imis_claim.code)
     fhir_claim.created = imis_claim.date_claimed.isoformat()
     fhir_claim.facility = LocationConverter.build_fhir_resource_reference(
         imis_claim.health_facility)
     cls.build_fhir_identifiers(fhir_claim, imis_claim)
     fhir_claim.patient = PatientConverter.build_fhir_resource_reference(
         imis_claim.insuree)
     cls.build_fhir_billable_period(fhir_claim, imis_claim)
     cls.build_fhir_diagnoses(fhir_claim, imis_claim)
     cls.build_fhir_total(fhir_claim, imis_claim)
     fhir_claim.enterer = PractitionerConverter.build_fhir_resource_reference(
         imis_claim.admin)
     cls.build_fhir_type(fhir_claim, imis_claim)
     cls.build_fhir_information(fhir_claim, imis_claim)
     cls.build_fhir_items(fhir_claim, imis_claim)
     return fhir_claim
 def build_fhir_practitioner_reference(cls, fhir_practitioner_role, imis_claim_admin):
     fhir_practitioner_role.practitioner = PractitionerConverter.build_fhir_resource_reference(imis_claim_admin)