This repository has been archived by the owner on Jan 21, 2021. It is now read-only.
forked from SEL-Columbia/dristhi
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
131 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 22 additions & 19 deletions
41
opensrp-connector/src/main/java/org/opensrp/connector/openmrs/service/OpenmrsService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,52 @@ | ||
package org.opensrp.connector.openmrs.service; | ||
|
||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
|
||
import org.opensrp.common.util.HttpUtil; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
|
||
@Component | ||
public abstract class OpenmrsService { | ||
|
||
@Value("#{opensrp['openmrs.url']}") | ||
protected String OPENMRS_BASE_URL; | ||
|
||
@Value("#{opensrp['openmrs.username']}") | ||
protected String OPENMRS_USER; | ||
|
||
@Value("#{opensrp['openmrs.password']}") | ||
protected String OPENMRS_PWD; | ||
|
||
public static final SimpleDateFormat OPENMRS_DATE = new SimpleDateFormat("yyyy-MM-dd"); | ||
public static final String PROBABLE_CAUSE_OF_DEATH_CONCEPT= "5002AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
public static final String PROBABLE_CAUSE_OF_DEATH_TEXT= "160218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
public static final String PROBABLE_CAUSE_PARENT_CONCEPT= "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
public OpenmrsService() { } | ||
|
||
|
||
public static final String PROBABLE_CAUSE_PARENT_CONCEPT = "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
|
||
public OpenmrsService() { | ||
} | ||
|
||
public OpenmrsService(String openmrsUrl, String user, String password) { | ||
OPENMRS_BASE_URL = openmrsUrl; | ||
OPENMRS_USER = user; | ||
OPENMRS_PWD = password; | ||
OPENMRS_BASE_URL = openmrsUrl; | ||
OPENMRS_USER = user; | ||
OPENMRS_PWD = password; | ||
} | ||
|
||
/** | ||
* returns url after trimming ending slash | ||
* | ||
* @return | ||
*/ | ||
public String getURL() { | ||
return HttpUtil.removeEndingSlash(OPENMRS_BASE_URL); | ||
} | ||
|
||
void setURL(String url) { | ||
OPENMRS_BASE_URL = url; | ||
} | ||
|
||
public static void main(String[] args) { | ||
System.out.println(OPENMRS_DATE.format(new Date())); | ||
public static void main(String[] args) { | ||
System.out.println(OPENMRS_DATE.format(new Date())); | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.