Skip to content

Commit

Permalink
Add metedata for NCD (#1927)
Browse files Browse the repository at this point in the history
  • Loading branch information
makombe authored Jun 26, 2024
1 parent d3dbb55 commit 2afdc72
Show file tree
Hide file tree
Showing 4 changed files with 183 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
*
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
*/
package org.openmrs.module.kenyaemr.metadata;

import org.openmrs.module.kenyaemr.Metadata;
import org.openmrs.module.metadatadeploy.bundle.AbstractMetadataBundle;
import org.openmrs.module.metadatadeploy.bundle.Requires;
import org.springframework.stereotype.Component;

import static org.openmrs.module.metadatadeploy.bundle.CoreConstructors.*;

/**
* OTZ metadata bundle
*/
@Component
@Requires({ CommonMetadata.class })
public class NCDMetadata extends AbstractMetadataBundle {

public static final class _EncounterType {
public static final String NCD_INITIAL = "dfcbe5d0-1afb-48a0-8f1e-5e5988b11f15";
public static final String NCD_FOLLOWUP = "b402d094-bff3-4b31-b167-82426b4e3e28";
}

public static final class _Form {
public static final String NCD_INITIAL_FORM = "c4994dd7-f2b6-4c28-bdc7-8b1d9d2a6a97";
public static final String NCD_FOLLOWUP_FORM = "3e1057da-f130-44d9-b2bb-53e039b953c6";
}


public static final class _Program {
public static final String NCD = "ffee43c4-9ccd-4e55-8a70-93194e7fafc6";
}

public static final class _Concept {

public static final String NCD = "a8085b61-45c0-41f0-b3f6-8a2d21715840";
}

/**
* @see AbstractMetadataBundle#install()
*/
@Override
public void install() {
install(encounterType("NCD Initial", "Enrolment into NCD", _EncounterType.NCD_INITIAL));
install(encounterType("NCD Followup", "NCD followup encounter", _EncounterType.NCD_FOLLOWUP));

install(form("NCD Enrollment Form", null, _EncounterType.NCD_INITIAL, "1", _Form.NCD_INITIAL_FORM));
install(form("NCD Followup Form", null, _EncounterType.NCD_FOLLOWUP, "1", _Form.NCD_FOLLOWUP_FORM));


install(program("NCD", "NCD program", _Concept.NCD, _Program.NCD));


}
}
79 changes: 79 additions & 0 deletions api/src/main/resources/content/kenyaemr.ncd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This Source Code Form is subject to the terms of the Mozilla Public License,
v. 2.0. If a copy of the MPL was not distributed with this file, You can
obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
graphic logo is a trademark of OpenMRS Inc.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<!-- ===================== Program ===================== -->

<bean id="kenyaemr.ncd.program" class="org.openmrs.module.kenyacore.program.ProgramDescriptor">
<property name="targetUuid" value="ffee43c4-9ccd-4e55-8a70-93194e7fafc6" />
<property name="defaultEnrollmentForm" ref="kenyaemr.ncd.form.initial" />
<property name="visitForms">
<set>
<ref bean="kenyaemr.ncd.form.followup" />
</set>
</property>
<property name="reports">
<set>
</set>
</property>
<property name="fragments">
<map>
<entry key="enrollment-summary" value="" />
<entry key="care-panel" value="" />
<entry key="completion-summary" value="" />
</map>
</property>
<property name="order" value="200" />
</bean>

<!-- ===================== Identifiers ===================== -->


<!-- ===================== Forms ===================== -->



<!-- NCD Intial form -->
<bean id="kenyaemr.ncd.form.initial" class="org.openmrs.module.kenyacore.form.FormDescriptor">
<property name="targetUuid" value="c4994dd7-f2b6-4c28-bdc7-8b1d9d2a6a97" />
<property name="apps">
<set>
<ref bean="kenyaemr.app.registration" />
<ref bean="kenyaemr.app.intake" />
<ref bean="kenyaemr.app.clinician" />
<ref bean="kenyaemr.app.chart" />
</set>
</property>
<property name="icon" value="kenyaui:forms/generic.png" />
<property name="htmlform" value="kenyaemr:ncd/formDoesNotExistOn2x.html" />
</bean>

<!-- NCD followup form -->
<bean id="kenyaemr.ncd.form.followup" class="org.openmrs.module.kenyacore.form.FormDescriptor">
<property name="targetUuid" value="3e1057da-f130-44d9-b2bb-53e039b953c6" />
<property name="apps">
<set>
<ref bean="kenyaemr.app.clinician" />
<ref bean="kenyaemr.app.chart" />
</set>
</property>
<property name="icon" value="kenyaui:forms/generic.png" />
<property name="htmlform" value="kenyaemr:ncd/formDoesNotExistOn2x.html" />
</bean>

<!-- ===================== Reports ===================== -->


</beans>
1 change: 1 addition & 0 deletions api/src/main/resources/moduleApplicationContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<import resource="content/kenyaemr.ovc.xml" />
<import resource="content/kenyaemr.vmmc.xml" />
<import resource="content/kenyaemr.mat.xml" />
<import resource="content/kenyaemr.ncd.xml" />

<!-- ===================== App descriptors ===================== -->

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--
~ The contents of this file are subject to the OpenMRS Public License
~ Version 1.0 (the "License"); you may not use this file except in
~ compliance with the License. You may obtain a copy of the License at
~ http://license.openmrs.org
~
~ Software distributed under the License is distributed on an "AS IS"
~ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
~ License for the specific language governing rights and limitations
~ under the License.
~
~ Copyright (C) OpenMRS, LLC. All Rights Reserved.
-->
<htmlform>
<script type="text/javascript">
jq(document).ready(function(){

});
</script>
<style>

</style>



<div class="ke-form-header">
<table width="100%">

</table>
</div>
<div class="ke-form-content">
<div>
This form DOES NOT EXIST in 2.x. Please use 3.x
</div>

</div>
<div class="ke-form-footer">

</div>

</htmlform>

0 comments on commit 2afdc72

Please sign in to comment.