This file contains hidden or 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
encryption.vector=2qtzvFDaDEeZbfzsNPFysg\=\= | |
connection.url=jdbc\:mysql\://localhost\:3306/openmrs_distro-icrc41?autoReconnect\=true&sessionVariables\=default_storage_engine%3DInnoDB&useUnicode\=true&characterEncoding\=UTF-8 | |
module.allow_web_admin=true | |
connection.username=root | |
auto_update_database=false | |
encryption.key=SLWgCzPamAHyCQYJ06mqeA\=\= | |
connection.driver_class=com.mysql.jdbc.Driver | |
connection.password=pass |
This file contains hidden or 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
/** | |
* Java implementation of the Bisection method for solving equations. | |
* | |
* @author samuel | |
*/ | |
public class Bisection { | |
private static final float TOLORANCE = (float) 0.001; | |
/** |
This file contains hidden or 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
public void shortListProgramsAndWorkflows(List<Program> programs, List<ProgramWorkflow> workflows) { | |
Predicate<Entry<ProgramWorkflow, Program>> predicate = entry -> { | |
return entry.getValue().getAllWorkflows().contains(entry.getKey()); | |
}; | |
filter(programs, workflows, predicate); | |
} | |
public void shortListWorkflowsAndStates(List<ProgramWorkflow> workflows, List<ProgramWorkflowState> states) { | |
Predicate<Entry<ProgramWorkflowState, ProgramWorkflow>> predicate = entry -> { | |
return entry.getValue().getStates(false).contains(entry.getKey()); |
This file contains hidden or 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 defines a generic {@link Bank} account {@link User}s can own | |
* | |
* @author samuel | |
* | |
*/ | |
public class Account { | |
// account number | |
private Integer accountNumber; |
This file contains hidden or 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
<!-- Introduce a class that will keep the input field and calender icon of the datetimepicker widget inline. --> | |
<style> | |
.datetimepicker { | |
/* Ideally the calendar icon will consume the rest of the 20% of the datetimepicker widget */ | |
width: 80%; | |
} | |
</style> | |
<!-- Include the fragment with this class --> | |
<obsFromFragment |
This file contains hidden or 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
<htmlform formUuid="c75f120a-04ec-11e3-8780-2b40bef9a44b" formName="Demo form" formEncounterType="d7151f82-c1f3-4152-a605-2f9ea7414a79" formVersion="1.0"> | |
<obsFromFragment conceptId="165185" provider="uicommons" fragment="field/text" fragmentParams="formFieldName=name&label=Name" initFragmentParamName="initialValue"/> | |
<br/> | |
<obsFromFragment conceptId="165178" provider="uicommons" fragment="field/datetimepicker" fragmentParams="formFieldName=my-date&label=My+Date&useTime=true" initFragmentParamName="defaultDate" /> | |
<br/> | |
<obsFromFragment conceptId="165179" provider="uicommons" fragment="field/dropDown" fragmentParams="formFieldName=favorite-lang&label=Favorite+Programing+Language" initFragmentParamName="initialValue"/> | |
<br/> | |
<obsFromFragment conceptId="165179" provider="uicommons" fragment="field/radioButtons" fragmentParams="formFieldName=core-lang&label=Core+Language" initFragmentParamName="initialValue"/> | |
<br/> | |
<ifMode mode="VIEW" include="false"> |
This file contains hidden or 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
<htmlform formUuid="c75f120a-04ec-11e3-8780-2b40bef9a44b" formName="Visit Note" formEncounterType="d7151f82-c1f3-4152-a605-2f9ea7414a79" formVersion="1.0"> | |
<obsFromFragment conceptId="165185" provider="uicommons" fragment="field/text" fragmentParams="formFieldName=name&label=Name" initFragmentParamName="initialValue"/> | |
<br/> | |
<obsFromFragment conceptId="165178" provider="uicommons" fragment="field/datetimepicker" fragmentParams="formFieldName=my-date&label=My+Date&useTime=true" initFragmentParamName="defaultDate" /> | |
<br/> | |
<obsFromFragment conceptId="165179" provider="uicommons" fragment="field/dropDown" fragmentParams="formFieldName=favorite-lang&label=Favorite+Programing+Language" initFragmentParamName="initialValue"/> | |
<br/> | |
<obsFromFragment conceptId="165179" provider="uicommons" fragment="field/radioButtons" fragmentParams="formFieldName=core-lang&label=Core+Language" initFragmentParamName="initialValue"/> | |
<br/> | |
<ifMode mode="VIEW" include="false"> |
This file contains hidden or 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
@PostMapping("safebusiness/addAct/{string}") | |
public String addAct(@Valid Act act, @PathVariable("string") String action, HttpServletRequest httpRequest) { | |
try { | |
// Try parsing id | |
Integer id = Integer.parseInt(action); | |
// If we reach this point, then we must be dealing with an update operation | |
// Pull the existing Act | |
act = actRepo.findById(id); | |
// act.setId(); NOTE : This should not be done while updating | |
Map<String, String[]> formData = httpRequest.getParameterMap(); |
This file contains hidden or 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
<?xml version="1.0"?> | |
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" > | |
<hibernate-mapping package="org.openmrs.module.idgen" > | |
<class name="IdentifierSource" table="idgen_identifier_source" abstract="true" > | |
<id name="id" type="int" column="id" unsaved-value="0"> | |
<generator class="native" /> | |
</id> | |
<discriminator column="source_type" /> | |
<property name="uuid" type="string" length="38" not-null="true" /> |
This file contains hidden or 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
<?xml version="1.0"?> | |
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" > | |
<hibernate-mapping package="org.openmrs.module.idgen" > | |
<class name="IdentifierSource" table="idgen_identifier_source" abstract="true" discriminator-value="IDENTIFIERSOURCE"> | |
<id name="id" type="int" column="id" unsaved-value="0"><generator class="native" /></id> | |
<property name="uuid" type="string" length="38" not-null="true" /> | |
<property name="name" type="string" not-null="true" /> | |
<property name="description" type="string" /> |