Search in sources :

Example 11 with DocumentedDefinition

use of org.openmrs.module.reporting.definition.library.DocumentedDefinition in project openmrs-module-pihcore by PIH.

the class PihPatientDataLibrary method getRegistrationAge.

@DocumentedDefinition("registration.age")
public PatientDataDefinition getRegistrationAge() {
    MappedData<PatientDataDefinition> effectiveDate = new MappedData<PatientDataDefinition>(getRegistrationDatetime(), null);
    AgeAtDateOfOtherDataDefinition ageAtRegistration = new AgeAtDateOfOtherDataDefinition();
    ageAtRegistration.setEffectiveDateDefinition(effectiveDate);
    return new ConvertedPatientDataDefinition(new PersonToPatientDataDefinition(ageAtRegistration), new AgeConverter("{y:1}"));
}
Also used : MappedData(org.openmrs.module.reporting.data.MappedData) AgeConverter(org.openmrs.module.reporting.data.converter.AgeConverter) PatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition) PersonToPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.PersonToPatientDataDefinition) ConvertedPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition) EncountersForPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.EncountersForPatientDataDefinition) AgeAtDateOfOtherDataDefinition(org.openmrs.module.reporting.data.person.definition.AgeAtDateOfOtherDataDefinition) PersonToPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.PersonToPatientDataDefinition) ConvertedPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 12 with DocumentedDefinition

use of org.openmrs.module.reporting.definition.library.DocumentedDefinition in project openmrs-module-pihcore by PIH.

the class PihPatientDataLibrary method getAllPrimaryIdentifiers.

@DocumentedDefinition
public PatientDataDefinition getAllPrimaryIdentifiers() {
    PatientIdentifierDataDefinition d = new PatientIdentifierDataDefinition();
    d.setTypes(Arrays.asList(emrApiProperties.getPrimaryIdentifierType()));
    return d;
}
Also used : PatientIdentifierDataDefinition(org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 13 with DocumentedDefinition

use of org.openmrs.module.reporting.definition.library.DocumentedDefinition in project openmrs-module-pihcore by PIH.

the class PihPatientDataLibrary method getUnknownPatient.

// Demographics
@DocumentedDefinition("unknownPatient.value")
public PatientDataDefinition getUnknownPatient() {
    PersonAttributeDataDefinition d = new PersonAttributeDataDefinition();
    d.setPersonAttributeType(emrApiProperties.getUnknownPatientPersonAttributeType());
    return convert(d, converters.getRawAttributeValue());
}
Also used : PersonAttributeDataDefinition(org.openmrs.module.reporting.data.person.definition.PersonAttributeDataDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 14 with DocumentedDefinition

use of org.openmrs.module.reporting.definition.library.DocumentedDefinition in project openmrs-module-pihcore by PIH.

the class PihCohortDefinitionLibrary method getSpecificCodedDiagnosesBetweenDates.

@DocumentedDefinition(value = "specificCodedDiagnosesBetweenDates")
public DiagnosisCohortDefinition getSpecificCodedDiagnosesBetweenDates() {
    DiagnosisCohortDefinition cd = new DiagnosisCohortDefinition();
    cd.addParameter(new Parameter("onOrAfter", "reporting.parameter.onOrAfter", Date.class));
    cd.addParameter(new Parameter("onOrBefore", "reporting.parameter.onOrBefore", Date.class));
    cd.addParameter(new Parameter("codedDiagnoses", "mirebalaisreports.parameter.codedDiagnoses", Concept.class, List.class, null));
    return cd;
}
Also used : Concept(org.openmrs.Concept) Parameter(org.openmrs.module.reporting.evaluation.parameter.Parameter) List(java.util.List) Date(java.util.Date) DiagnosisCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.DiagnosisCohortDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 15 with DocumentedDefinition

use of org.openmrs.module.reporting.definition.library.DocumentedDefinition in project openmrs-module-pihcore by PIH.

the class PihCohortDefinitionLibrary method getInpatientAtLocationOnDate.

@DocumentedDefinition(value = "inpatientAtLocationOnDate")
public CohortDefinition getInpatientAtLocationOnDate() {
    InpatientLocationCohortDefinition cd = new InpatientLocationCohortDefinition();
    cd.addParameter(parameter(Date.class, "effectiveDate"));
    cd.addParameter(parameter(Location.class, "ward"));
    return new MappedParametersCohortDefinition(cd, "ward", "location", "effectiveDate", "date");
}
Also used : InpatientLocationCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.InpatientLocationCohortDefinition) Date(java.util.Date) Location(org.openmrs.Location) MappedParametersCohortDefinition(org.openmrs.module.reporting.cohort.definition.MappedParametersCohortDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Aggregations

DocumentedDefinition (org.openmrs.module.reporting.definition.library.DocumentedDefinition)29 Date (java.util.Date)11 Location (org.openmrs.Location)10 MappedParametersCohortDefinition (org.openmrs.module.reporting.cohort.definition.MappedParametersCohortDefinition)9 ConvertedEncounterDataDefinition (org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition)6 Parameter (org.openmrs.module.reporting.evaluation.parameter.Parameter)6 DiedSoonAfterEncounterCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.DiedSoonAfterEncounterCohortDefinition)5 InpatientTransferCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.InpatientTransferCohortDefinition)5 ObjectFormatter (org.openmrs.module.reporting.data.converter.ObjectFormatter)5 DiagnosisCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.DiagnosisCohortDefinition)4 InpatientLocationCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.InpatientLocationCohortDefinition)4 EncounterCohortDefinition (org.openmrs.module.reporting.cohort.definition.EncounterCohortDefinition)4 EncounterWithCodedObsCohortDefinition (org.openmrs.module.reporting.cohort.definition.EncounterWithCodedObsCohortDefinition)4 PersonAttributeCohortDefinition (org.openmrs.module.reporting.cohort.definition.PersonAttributeCohortDefinition)4 EncounterProviderDataDefinition (org.openmrs.module.reporting.data.encounter.definition.EncounterProviderDataDefinition)4 ObsForEncounterDataDefinition (org.openmrs.module.reporting.data.encounter.definition.ObsForEncounterDataDefinition)4 LastDispositionBeforeExitCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.LastDispositionBeforeExitCohortDefinition)3 CohortDefinition (org.openmrs.module.reporting.cohort.definition.CohortDefinition)3 CompositionCohortDefinition (org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition)3 PropertyConverter (org.openmrs.module.reporting.data.converter.PropertyConverter)3