Example #1
0
 def __map_status(cls, code):
     codes = {
         1: Stu3CoverageConfig.get_status_idle_code(),
         2: Stu3CoverageConfig.get_status_active_code(),
         4: Stu3CoverageConfig.get_status_suspended_code(),
         8: Stu3CoverageConfig.get_status_expired_code(),
     }
     return codes[code]
Example #2
0
    def __build_product_plan_display(cls, grouping, product):
        product_coverage = {}
        service_code = Stu3CoverageConfig.get_service_code()
        item_code = Stu3CoverageConfig.get_item_code()
        product_items = ProductItem.objects.filter(product=product).all()
        product_services = ProductService.objects.filter(product=product).all()

        product_coverage[item_code] = [
            item.item.code for item in product_items
        ]
        product_coverage[service_code] = [
            service.service.code for service in product_services
        ]
        grouping.plan = product.name
        grouping.planDisplay = str(product_coverage)
Example #3
0
 def build_coverage_policy_holder(cls, fhir_coverage, imis_policy):
     reference = Reference()
     resource_type = Stu3CoverageConfig.get_family_reference_code()
     resource_id = imis_policy.family.uuid
     reference.reference = resource_type + '/' + str(resource_id)
     fhir_coverage.policyHolder = reference
     return fhir_coverage
Example #4
0
    def build_coverage_grouping(cls, fhir_coverage, imis_coverage):
        grouping = CoverageGrouping()
        product = imis_coverage.product
        grouping.group = Stu3CoverageConfig.get_product_code() + "/" + str(
            product.uuid)
        grouping.groupDisplay = product.code

        cls.__build_product_plan_display(grouping, product)
        fhir_coverage.grouping = grouping
Example #5
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]
Example #6
0
 def __build_enroll_date(cls, fhir_coverage, imis_coverage):
     enroll_date = cls.__build_date_extension(
         imis_coverage.enroll_date,
         Stu3CoverageConfig.get_enroll_date_code())
     fhir_coverage.extension.append(enroll_date)