zzPPP_CoverageImpl.wstl · fhir2omop
refs/refs/mends-on-fhir/whistle-mappings/synthea/whistle-functions/zzPPP_CoverageImpl.wstl
77 lines · wstl
2// 2022-09-09: Add source_concept to payor.type CodeableConcept 3// 2022-09-09: Use plan source value as proxy for (mandatory) payor 4// 2022-09-02: Created PPP.payor-concept-id --> Coverage.type concept map 6def PPP_CoverageImpl(PPP, context) { 7 resourceType: "Coverage" 9// from Resource: id, meta, implicitRules, and language 10 id: PPP.payer_plan_period_id 11 meta.profile[].url: "" 15// from DomainResource: text, contained, extension, and modifierExtension 21// from https://www.hl7.org/fhir/coverage.html 22 identifier[]: Identifier(Identifier_System("omop-id"), PPP.payer_plan_period_id) 29 beneficiary: Reference("Patient",PPP.person_id) 33 if context.config.output.phi = "yes" { 34 period.start: ReformatDatetime(PPP.payer_plan_period_start_date) 35 period.end: ReformatDatetime(PPP.payer_plan_period_end_date) 37 period.start: ReformatDatetime("2030-01-01") 38 period.end: ReformatDatetime("2030-01-01") 43 // "The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements" 44 // "Reference (Organization | Patient | RelatedPerson)" 45 // "Need to identify the issuer to target for claim processing and for coordination of benefit procecessing" 46 //" May provide multiple identifiers such as insurance company identifier or business identifier (BIN number)." 47 // "For selfpay it may provide multiple paying persons and/or organizations" 48 // Best approximate proxy in OMOP: plan_source_value 50 // Use Reference.display: PPP.plan_source_value 51 payor[].display: PPP.plan_source_value 56 costToBeneficiary[]: "" 61// ******* End of PPP_Coverage ************* 64// ************************************************************************* 66// * All PPP-specific function calls here. 67// * Function calls useful accross resources are in DataTypes.wstl 69// ************************************************************************* 72 $this: CodeableConceptMapNull(PPP.payer_concept_id, "PPP.payor-concept-id--Coverage.type", PPP.payer_source_value) 73 if PPP.payer_concept_id ~= PPP.payer_source_concept_id { 74 coding[]: Coding(Code_System(PPP.payer_source_vocabulary_id), "", PPP.payer_source_concept_code, PPP.payer_source_concept_name)