def build_contract_party(cls, contract, imis_coverage): if imis_coverage.officer is not None: party = ContractTermOfferParty() reference = PractitionerConverter.build_fhir_resource_reference( imis_coverage.officer) party.reference = reference provider_role = cls.build_simple_codeable_concept( R4CoverageConfig.get_practitioner_role_code()) party.role = [provider_role] contract.term[0].offer[0].party[0] = [party]
def build_contract_party(cls, contract, imis_coverage): if imis_coverage.officer is not None: party = ContractTermOfferParty() reference = PractitionerConverter.build_fhir_resource_reference( imis_coverage.officer) party.reference.append(reference) if contract.term is None: contract.term.append[ContractTerm()] elif len(contract.term) == 0: contract.term.append(ContractTerm()) if contract.term[0].offer is None: contract.term[0].offer = ContractTermOffer() provider_role = cls.build_simple_codeable_concept( R4CoverageConfig.get_practitioner_role_code()) party.role = provider_role contract.term[0].offer.party.append(party)