def build_fhir_diagnosis(cls, diagnoses, icd_code, icd_type): claim_diagnosis = ClaimDiagnosis() claim_diagnosis.sequence = FhirUtils.get_next_array_sequential_id( diagnoses) claim_diagnosis.diagnosisCodeableConcept = cls.build_codeable_concept( icd_code, None) claim_diagnosis.type = [cls.build_simple_codeable_concept(icd_type)] diagnoses.append(claim_diagnosis)
def build_process_note(cls, fhir_claim_response, string_value): result = None if string_value: note = ClaimResponseProcessNote() note.number = FhirUtils.get_next_array_sequential_id( fhir_claim_response.processNote) note.text = string_value fhir_claim_response.processNote.append(note) result = note return result
def build_fhir_string_information(cls, claim_information, code, value_string): result = None if value_string: information_concept = ClaimInformation() information_concept.sequence = FhirUtils.get_next_array_sequential_id( claim_information) information_concept.category = cls.build_simple_codeable_concept( code) information_concept.valueString = value_string claim_information.append(information_concept) result = information_concept return result
def build_fhir_item(cls, fhir_claim, code, item_type, item): fhir_item = FHIRClaimItem() fhir_item.sequence = FhirUtils.get_next_array_sequential_id( fhir_claim.item) unit_price = Money() unit_price.value = item.price_asked fhir_item.unitPrice = unit_price fhir_quantity = Quantity() fhir_quantity.value = item.qty_provided fhir_item.quantity = fhir_quantity fhir_item.service = cls.build_simple_codeable_concept(code) fhir_item.category = cls.build_simple_codeable_concept(item_type) item_explanation_code = Stu3ClaimConfig.get_fhir_claim_item_explanation_code( ) information = cls.build_fhir_string_information( fhir_claim.information, item_explanation_code, item.explanation) if information: fhir_item.informationLinkId = [information.sequence] fhir_claim.item.append(fhir_item)