Skip to content

Commit

Permalink
Merge pull request #1 from esaude/MPOC-267
Browse files Browse the repository at this point in the history
Sushant | MPOC-267 Allergies section
  • Loading branch information
joaomachiana authored Jun 25, 2019
2 parents 2ad45b0 + 56d65aa commit 55825d0
Show file tree
Hide file tree
Showing 32 changed files with 1,684 additions and 5 deletions.
86 changes: 86 additions & 0 deletions Allergy/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>emrapi</artifactId>
<version>1.28.0-SNAPSHOT</version>
</parent>
<groupId>org.openmrs.module</groupId>
<artifactId>emrapi-Allergy</artifactId>
<version>1.28.0-SNAPSHOT</version>
<name>EMR API Allergy</name>

<url>http://maven.apache.org</url>

<properties>
<openMRSVersion>1.10.2</openMRSVersion>
</properties>


<dependencies>
<dependency>
<groupId>org.openmrs.api</groupId>
<artifactId>openmrs-api</artifactId>
<version>${openMRSVersion}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.openmrs.api</groupId>
<artifactId>openmrs-api</artifactId>
<type>test-jar</type>
<version>${openMRSVersion}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.openmrs.test</groupId>
<artifactId>openmrs-test</artifactId>
<version>${openMRSVersion}</version>
<type>pom</type>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>

<testResources>
<testResource>
<directory>src/test/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</testResource>
<testResource>
<directory>src/test/resources</directory>
<excludes>
<exclude>**/*.properties</exclude>
<exclude>**/*.xml</exclude>
</excludes>
<filtering>false</filtering>
</testResource>
</testResources>
</build>

</project>
13 changes: 13 additions & 0 deletions Allergy/src/main/java/org/Allergy/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.Allergy;

/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package org.openmrs.module.emrapi.allergy;

import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.openmrs.Concept;
import org.openmrs.module.emrapi.allergy.Allergy_New;

public class AllergyHistory {
private String nonCodedAllergy;

private Concept allergy;

private List<Allergy_New> allergy_News;

public String getNonCodedAllergy() {
return nonCodedAllergy;
}

public void setNonCodedAllergy(String nonCodedAllergy) {
this.nonCodedAllergy = nonCodedAllergy;
}

public Concept getAllergy() {
return allergy;
}

public void setAllergy(Concept allergy) {
this.allergy = allergy;
}

public List<Allergy_New> getAllergies() {
return allergy_News;
}

public void setAllergies(List<Allergy_New> allergy_News) {
this.allergy_News = allergy_News;
}

@Override
public String toString() {
String name = nonCodedAllergy;
if (name != null && allergy != null && allergy.getName() != null) {
name = allergy.getName().getName();
}

return new ToStringBuilder(this).append("allergy", name).append("count", allergy_News.size()).build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.openmrs.module.emrapi.allergy;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


public class AllergyListConstant {

private static Log log = LogFactory.getLog(AllergyListConstant.class);

public static final String GP_END_REASON_CONCEPT_SET_UUID = "alergyList.endReasonConceptSetUuid";

public static final String GLOBAL_PROPERTY_NON_CODED_UUID = "alergyList.nonCodedUuid";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.openmrs.module.emrapi.allergy;

import java.util.List;

import org.openmrs.Concept;
import org.openmrs.Patient;
import org.openmrs.annotation.Authorized;
import org.openmrs.api.OpenmrsService;


@Deprecated
public interface AllergyService extends OpenmrsService {

@Authorized({ PrivilegeAllergyConstant.EDIT_ALLERGIES })
Allergy_New save(Allergy_New allergy_New);

@Authorized({ PrivilegeAllergyConstant.EDIT_ALLERGIES })
Allergy_New voidAllergy(Allergy_New allergy_New, String voidReason);

Allergy_New getAllergyByUuid(String uuid);

List<AllergyHistory> getAllergyHistory(Patient patient);

@Authorized({ PrivilegeAllergyConstant.GET_ALLERGIES })
List<Allergy_New> getActiveAllergy(Patient patient);

List<Concept> getEndReasonConcepts();
}
Loading

0 comments on commit 55825d0

Please sign in to comment.