Search in sources :

Example 6 with ConvertedEncounterDataDefinition

use of org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition in project openmrs-module-pihcore by PIH.

the class PihEncounterDataLibrary method getAdmissionStatus.

@DocumentedDefinition
public EncounterDataDefinition getAdmissionStatus() {
    ObsForEncounterDataDefinition dd = new ObsForEncounterDataDefinition();
    // concept with synonyms "Type of Patient" and "Admission Status", possible answers are Ambulatory and Hospitalized
    dd.setQuestion(conceptService.getConceptByMapping("3289", "PIH"));
    return new ConvertedEncounterDataDefinition(dd, new PropertyConverter(Obs.class, "valueCoded"), new ObjectFormatter());
}
Also used : ObsForEncounterDataDefinition(org.openmrs.module.reporting.data.encounter.definition.ObsForEncounterDataDefinition) Obs(org.openmrs.Obs) ObjectFormatter(org.openmrs.module.reporting.data.converter.ObjectFormatter) ConvertedEncounterDataDefinition(org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition) PropertyConverter(org.openmrs.module.reporting.data.converter.PropertyConverter) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 7 with ConvertedEncounterDataDefinition

use of org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition in project openmrs-module-pihcore by PIH.

the class PihEncounterDataLibrary method getRequestedAdmissionLocationName.

@DocumentedDefinition
public EncounterDataDefinition getRequestedAdmissionLocationName() {
    ObsForEncounterDataDefinition dd = new ObsForEncounterDataDefinition();
    dd.setQuestion(dispositionService.getDispositionDescriptor().getAdmissionLocationConcept());
    return new ConvertedEncounterDataDefinition(dd, new ObsValueTextAsCodedConverter<Location>(Location.class), new ObjectFormatter());
}
Also used : ObsForEncounterDataDefinition(org.openmrs.module.reporting.data.encounter.definition.ObsForEncounterDataDefinition) ObjectFormatter(org.openmrs.module.reporting.data.converter.ObjectFormatter) ConvertedEncounterDataDefinition(org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition) Location(org.openmrs.Location) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 8 with ConvertedEncounterDataDefinition

use of org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition in project openmrs-module-pihcore by PIH.

the class PihEncounterDataLibrary method getRequestedTransferLocationName.

@DocumentedDefinition
public EncounterDataDefinition getRequestedTransferLocationName() {
    ObsForEncounterDataDefinition dd = new ObsForEncounterDataDefinition();
    dd.setQuestion(dispositionService.getDispositionDescriptor().getInternalTransferLocationConcept());
    return new ConvertedEncounterDataDefinition(dd, new ObsValueTextAsCodedConverter<Location>(Location.class), new ObjectFormatter());
}
Also used : ObsForEncounterDataDefinition(org.openmrs.module.reporting.data.encounter.definition.ObsForEncounterDataDefinition) ObjectFormatter(org.openmrs.module.reporting.data.converter.ObjectFormatter) ConvertedEncounterDataDefinition(org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition) Location(org.openmrs.Location) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Aggregations

ConvertedEncounterDataDefinition (org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition)8 ObjectFormatter (org.openmrs.module.reporting.data.converter.ObjectFormatter)6 DocumentedDefinition (org.openmrs.module.reporting.definition.library.DocumentedDefinition)6 PropertyConverter (org.openmrs.module.reporting.data.converter.PropertyConverter)4 EncounterProviderDataDefinition (org.openmrs.module.reporting.data.encounter.definition.EncounterProviderDataDefinition)4 ObsForEncounterDataDefinition (org.openmrs.module.reporting.data.encounter.definition.ObsForEncounterDataDefinition)3 Location (org.openmrs.Location)2 Person (org.openmrs.Person)2 Provider (org.openmrs.Provider)2 Date (java.util.Date)1 Obs (org.openmrs.Obs)1 Visit (org.openmrs.Visit)1 AgeConverter (org.openmrs.module.reporting.data.converter.AgeConverter)1 ChainedConverter (org.openmrs.module.reporting.data.converter.ChainedConverter)1 CollectionConverter (org.openmrs.module.reporting.data.converter.CollectionConverter)1 CountConverter (org.openmrs.module.reporting.data.converter.CountConverter)1 EncounterLocationDataDefinition (org.openmrs.module.reporting.data.encounter.definition.EncounterLocationDataDefinition)1 EncounterDataSetDefinition (org.openmrs.module.reporting.dataset.definition.EncounterDataSetDefinition)1 Parameter (org.openmrs.module.reporting.evaluation.parameter.Parameter)1 BasicEncounterQuery (org.openmrs.module.reporting.query.encounter.definition.BasicEncounterQuery)1