/** @see AbstractMetadataBundle#install() */
  @Override
  public void install() {

    log.info("Install Metadata Sharing Packages");

    // installMetadataSharingPackage("HUM_Metadata-57.zip", Packages.HUM_METADATA);

    log.info("Setting Global Properties");

    Map<String, String> properties = new LinkedHashMap<String, String>();

    // OpenMRS Core
    properties.put(OpenmrsConstants.GLOBAL_PROPERTY_LOCALE_ALLOWED_LIST, "ht, fr, en");
    properties.put(OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCALE, DEFAULT_LOCALE);

    // EMR API
    properties.put(
        EmrApiConstants.GP_EXTRA_PATIENT_IDENTIFIER_TYPES,
        HaitiPatientIdentifierTypes.DOSSIER_NUMBER.uuid()
            + ","
            + HaitiPatientIdentifierTypes.HIVEMR_V1.uuid());
    properties.put(
        EmrApiConstants.PRIMARY_IDENTIFIER_TYPE, HaitiPatientIdentifierTypes.ZL_EMR_ID.name());

    // Paper Record
    properties.put(
        PaperRecordConstants.GP_PAPER_RECORD_IDENTIFIER_TYPE,
        HaitiPatientIdentifierTypes.DOSSIER_NUMBER.uuid());
    properties.put(
        PaperRecordConstants.GP_EXTERNAL_DOSSIER_IDENTIFIER_TYPE,
        HaitiPatientIdentifierTypes.EXTERNAL_DOSSIER_NUMBER.uuid());

    // Core Apps
    properties.put(
        CoreAppsConstants.GP_DEFAULT_PATIENT_IDENTIFIER_LOCATION,
        MirebalaisLocations.MIREBALAIS_CDI_PARENT.uuid());

    // Patient Registration
    properties.put(
        PatientRegistrationGlobalProperties.SUPPORTED_TASKS,
        "patientRegistration|primaryCareReception|edCheckIn|patientLookup");
    properties.put(
        PatientRegistrationGlobalProperties.SEARCH_CLASS,
        DefaultPatientRegistrationSearch.class.getName());
    properties.put(PatientRegistrationGlobalProperties.LABEL_PRINT_COUNT, "1");
    properties.put(
        PatientRegistrationGlobalProperties.PROVIDER_ROLES,
        ""); // note that this global property is only used for the primary care visit component of
             // the Patient Registration module, which we aren't using in Mirebalais
    properties.put(
        PatientRegistrationGlobalProperties.ID_CARD_LABEL_TEXT, "Zanmi Lasante Patient ID Card");
    properties.put(PatientRegistrationGlobalProperties.BIRTH_YEAR_INTERVAL, "1");
    properties.put(
        PatientRegistrationGlobalProperties.MEDICAL_RECORD_LOCATION_TAG,
        LocationTags.MEDICAL_RECORD_LOCATION.uuid());
    properties.put(
        PatientRegistrationGlobalProperties.PRIMARY_IDENTIFIER_TYPE,
        HaitiPatientIdentifierTypes.ZL_EMR_ID.name());
    properties.put(
        PatientRegistrationGlobalProperties.NUMERO_DOSSIER,
        HaitiPatientIdentifierTypes.DOSSIER_NUMBER.uuid());
    properties.put(
        PatientRegistrationGlobalProperties.EXTERNAL_NUMERO_DOSSIER,
        HaitiPatientIdentifierTypes.EXTERNAL_DOSSIER_NUMBER.uuid());
    properties.put(
        PatientRegistrationGlobalProperties.PROVIDER_IDENTIFIER_PERSON_ATTRIBUTE_TYPE,
        PersonAttributeTypes.PROVIDER_IDENTIFIER.name());
    properties.put(
        PatientRegistrationGlobalProperties.ID_CARD_PERSON_ATTRIBUTE_TYPE,
        PersonAttributeTypes.TELEPHONE_NUMBER.name());
    properties.put(
        PatientRegistrationGlobalProperties.PATIENT_VIEWING_ATTRIBUTE_TYPES,
        PersonAttributeTypes.TELEPHONE_NUMBER.name());
    properties.put(
        PatientRegistrationGlobalProperties.PATIENT_REGISTRATION_ENCOUNTER_TYPE,
        REGISTRATION_ENCOUNTER_NAME);
    properties.put(
        PatientRegistrationGlobalProperties.PRIMARY_CARE_RECEPTION_ENCOUNTER_TYPE,
        CHECK_IN_ENCOUNTER_NAME);
    properties.put(
        PatientRegistrationGlobalProperties.PRIMARY_CARE_VISIT_ENCOUNTER_TYPE,
        PRIMARY_CARE_VISIT_ENCOUNTER_NAME);

    // TODO: For all of these, determine best way to set metadata against these
    properties.put(
        PatientRegistrationGlobalProperties.URGENT_DIAGNOSIS_CONCEPT,
        "PIH: Haiti nationally urgent diseases");
    properties.put(
        PatientRegistrationGlobalProperties.NOTIFY_DIAGNOSIS_CONCEPT,
        "PIH: Haiti nationally notifiable diseases");
    properties.put(
        PatientRegistrationGlobalProperties.NON_CODED_DIAGNOSIS_CONCEPT,
        "PIH: ZL Primary care diagnosis non-coded");
    properties.put(
        PatientRegistrationGlobalProperties.NEONATAL_DISEASES_CONCEPT,
        "PIH: Haiti neonatal diseases");
    properties.put(
        PatientRegistrationGlobalProperties.CODED_DIAGNOSIS_CONCEPT,
        "PIH: HUM Outpatient diagnosis");
    properties.put(
        PatientRegistrationGlobalProperties.AGE_RESTRICTED_CONCEPT,
        "PIH: Haiti age restricted diseases");
    properties.put(
        PatientRegistrationGlobalProperties.RECEIPT_NUMBER_CONCEPT,
        "PIH: Receipt number|en:Receipt Number|ht:Nimewo Resi a");
    properties.put(
        PatientRegistrationGlobalProperties.PAYMENT_AMOUNT_CONCEPT,
        "PIH: Payment amount|en:Payment amount|ht:Kantite lajan");
    properties.put(
        PatientRegistrationGlobalProperties.VISIT_REASON_CONCEPT,
        "PIH: Type of HUM visit|en:Visit reason|ht:Tip de Vizit");
    properties.put(
        PatientRegistrationGlobalProperties.ICD10_CONCEPT_SOURCE,
        "ICD-10"); // probably not being used except in Lacolline

    setGlobalProperties(properties);
  }
  /** @see AbstractMetadataBundle#install() */
  @Override
  public void install() {

    // note that the radiology order type itself is installed as part of the OrderTypes bundle
    install(EncounterTypes.RADIOLOGY_ORDER);
    install(EncounterTypes.RADIOLOGY_REPORT);
    install(EncounterTypes.RADIOLOGY_STUDY);
    install(
        encounterRole(
            "Radiology Technician",
            "Radiology Technician - person who performs radiology studies",
            EncounterRoles.RADIOLOGY_TECHNICIAN));
    install(
        encounterRole(
            "Principal Results Interpreter",
            "Principal Results Interpreter - the provider responsible for interpreting the results of a radiology study",
            EncounterRoles.PRINCIPAL_RESULTS_INTERPRETER));
    /*
    boolean conceptsInstalled = installMetadataSharingPackage("HUM_Radiology_Orderables-12.zip", Packages.RADIOLOGY_ORDERABLES);
    if (conceptsInstalled) {
    	verifyConceptPresent(RadiologyConstants.CONCEPT_CODE_RADIOLOGY_PROCEDURE, EmrApiConstants.EMR_CONCEPT_SOURCE_NAME);
    	verifyConceptPresent(RadiologyConstants.CONCEPT_CODE_RADIOLOGY_REPORT_TYPE, EmrApiConstants.EMR_CONCEPT_SOURCE_NAME);
    	verifyConceptPresent(RadiologyConstants.CONCEPT_CODE_RADIOLOGY_REPORT_BODY, EmrApiConstants.EMR_CONCEPT_SOURCE_NAME);
    	verifyConceptPresent(RadiologyConstants.CONCEPT_CODE_RADIOLOGY_ORDER_NUMBER, EmrApiConstants.EMR_CONCEPT_SOURCE_NAME);
    	verifyConceptPresent(RadiologyConstants.CONCEPT_CODE_RADIOLOGY_IMAGES_AVAILABLE, EmrApiConstants.EMR_CONCEPT_SOURCE_NAME);
    	verifyConceptPresent(RadiologyConstants.CONCEPT_CODE_RADIOLOGY_REPORT_CORRECTION, EmrApiConstants.EMR_CONCEPT_SOURCE_NAME);
    	verifyConceptPresent(RadiologyConstants.CONCEPT_CODE_RADIOLOGY_REPORT_FINAL, EmrApiConstants.EMR_CONCEPT_SOURCE_NAME);
    	verifyConceptPresent(RadiologyConstants.CONCEPT_CODE_RADIOLOGY_REPORT_PRELIM, EmrApiConstants.EMR_CONCEPT_SOURCE_NAME);
    	verifyConceptPresent(RadiologyConstants.CONCEPT_CODE_RADIOLOGY_STUDY_SET, EmrApiConstants.EMR_CONCEPT_SOURCE_NAME);
    	verifyConceptPresent(RadiologyConstants.CONCEPT_CODE_RADIOLOGY_REPORT_SET, EmrApiConstants.EMR_CONCEPT_SOURCE_NAME);
    }*/

    Map<String, String> properties = new LinkedHashMap<String, String>();

    // Radiology
    properties.put(
        RadiologyConstants.GP_RADIOLOGY_ORDER_ENCOUNTER_TYPE,
        EncounterTypes.RADIOLOGY_ORDER.uuid());
    properties.put(
        RadiologyConstants.GP_RADIOLOGY_STUDY_ENCOUNTER_TYPE,
        EncounterTypes.RADIOLOGY_STUDY.uuid());
    properties.put(
        RadiologyConstants.GP_RADIOLOGY_REPORT_ENCOUNTER_TYPE,
        EncounterTypes.RADIOLOGY_REPORT.uuid());
    properties.put(
        RadiologyConstants.GP_RADIOLOGY_TEST_ORDER_TYPE, OrderTypes.RADIOLOGY_TEST_ORDER.uuid());
    properties.put(RadiologyConstants.GP_XRAY_ORDERABLES_CONCEPT, Concepts.XRAY_ORDERABLES);
    properties.put(RadiologyConstants.GP_CT_SCAN_ORDERABLES_CONCEPT, Concepts.CT_SCAN_ORDERABLES);
    properties.put(
        RadiologyConstants.GP_ULTRASOUND_ORDERABLES_CONCEPT, Concepts.ULTRASOUND_ORDERABLES);
    properties.put(RadiologyConstants.GP_CONTRAST_ORDERABLES_CONCEPT, Concepts.CONTRAST_ORDERABLES);
    properties.put(RadiologyConstants.GP_CREATININE_LEVEL_CONCEPT, Concepts.CREATININE_LEVEL);
    properties.put(
        RadiologyConstants.GP_RADIOLOGY_TECHNICIAN_ENCOUNTER_ROLE,
        EncounterRoles.RADIOLOGY_TECHNICIAN);
    properties.put(
        RadiologyConstants.GP_PRINCIPAL_RESULTS_INTERPRETER_ENCOUNTER_ROLE,
        EncounterRoles.PRINCIPAL_RESULTS_INTERPRETER);
    properties.put(RadiologyConstants.GP_LEAD_RADIOLOGY_TECH_NAME, "Edner");
    properties.put(RadiologyConstants.GP_LEAD_RADIOLOGY_TECH_CONTACT_INFO, "4868-9765");

    // PACS Integration
    properties.put(
        PacsIntegrationConstants.GP_PATIENT_IDENTIFIER_TYPE_UUID,
        HaitiPatientIdentifierTypes.ZL_EMR_ID.uuid());
    properties.put(PacsIntegrationConstants.GP_DEFAULT_LOCALE, "en");
    properties.put(PacsIntegrationConstants.GP_SENDING_FACILITY, "Mirebalais");
    properties.put(
        PacsIntegrationConstants.GP_PROCEDURE_CODE_CONCEPT_SOURCE_UUID,
        CoreConceptMetadataBundle.ConceptSources.LOINC);
    properties.put(
        PacsIntegrationConstants.GP_LOCATION_CODE_ATTRIBUTE_TYPE_UUID,
        LocationAttributeTypes.LOCATION_CODE.uuid());
    properties.put(PacsIntegrationConstants.GP_HL7_LISTENER_PORT, "6663");

    setGlobalProperties(properties);
  }