Permalink
Browse files

ATT-24: includeRetired becomes includeVoided

Thanks @ridmal !
  • Loading branch information...
ridmal authored and mks-d committed Jul 30, 2018
1 parent c4d6b91 commit 9095a675e2d84145a1d185e175aee17fb9aad121
@@ -14,49 +14,49 @@
* Get a patient's attachments including attachments that are not associated with any visits or
* encounters.
*
* @param includeRetired Specifies whether the underlying complex obs that are fetched should
* include retired ones or not.
* @param includeVoided Specifies whether the underlying complex obs that are fetched should include
* voided ones or not.
* @throws APIException if non-complex obs are mistakenly returned
*/
List<Attachment> getAttachments(Patient patient, boolean includeRetired);
List<Attachment> getAttachments(Patient patient, boolean includeVoided);
/**
* Get a patient's attachments.
*
* @param includeRetired Specifies whether the underlying complex obs that are fetched should
* include retired ones or not.
* @param includeVoided Specifies whether the underlying complex obs that are fetched should include
* voided ones or not.
* @param includeEncounterless Specifies whether the underlying attachments that are fetched should
* include attachments that are not associated with any visits or encounters.
* @throws APIException if non-complex obs are mistakenly returned
*/
List<Attachment> getAttachments(Patient patient, boolean includeEncounterless, boolean includeRetired);
List<Attachment> getAttachments(Patient patient, boolean includeEncounterless, boolean includeVoided);
/**
* Get a patient's attachments that are not associated with any visits or encounters.
*
* @param includeRetired Specifies whether the underlying complex obs that are fetched should
* include retired ones or not.
* @param includeVoided Specifies whether the underlying complex obs that are fetched should include
* voided ones or not.
* @throws APIException if non-complex obs are mistakenly returned
*/
List<Attachment> getEncounterlessAttachments(Patient patient, boolean includeRetired);
List<Attachment> getEncounterlessAttachments(Patient patient, boolean includeVoided);
/**
* Get a patient's attachments that are associated with a specified encounter.
*
* @param encounter the encounter which attachment to get
* @param includeRetired Specifies whether the underlying complex obs that are fetched should
* include retired ones or not.
* @param includeVoided Specifies whether the underlying complex obs that are fetched should include
* voided ones or not.
* @throws APIException if non-complex obs are mistakenly returned
*/
List<Attachment> getAttachments(Patient patient, Encounter encounter, boolean includeRetired);
List<Attachment> getAttachments(Patient patient, Encounter encounter, boolean includeVoided);
/**
* Get a patient's attachments that are associated with a specified visit.
*
* @param visit the visit which attachments to get
* @param includeRetired Specifies whether the underlying complex obs that are fetched should
* include retired ones or not.
* @param includeVoided Specifies whether the underlying complex obs that are fetched should include
* voided ones or not.
* @throws APIException if non-complex obs are mistakenly returned
*/
List<Attachment> getAttachments(Patient patient, Visit visit, boolean includeRetired);
List<Attachment> getAttachments(Patient patient, Visit visit, boolean includeVoided);
}
@@ -28,13 +28,13 @@
private AttachmentsContext ctx;
@Override
public List<Attachment> getAttachments(Patient patient, boolean includeEncounterless, boolean includeRetired) {
public List<Attachment> getAttachments(Patient patient, boolean includeEncounterless, boolean includeVoided) {
List<Person> persons = new ArrayList<>();
List<Concept> questionConcepts = getAttachmentConcepts();
persons.add(patient);
List<Obs> obsList = ctx.getObsService().getObservations(persons, null, questionConcepts, null, null, null, null,
null, null, null, null, includeRetired);
null, null, null, null, includeVoided);
List<Attachment> attachments = new ArrayList<>();
for (Obs obs : obsList) {
@@ -51,18 +51,18 @@
}
@Override
public List<Attachment> getAttachments(Patient patient, boolean includeRetired) {
return getAttachments(patient, true, includeRetired);
public List<Attachment> getAttachments(Patient patient, boolean includeVoided) {
return getAttachments(patient, true, includeVoided);
}
@Override
public List<Attachment> getEncounterlessAttachments(Patient patient, boolean includeRetired) {
public List<Attachment> getEncounterlessAttachments(Patient patient, boolean includeVoided) {
List<Person> persons = new ArrayList<>();
List<Concept> questionConcepts = getAttachmentConcepts();
persons.add(patient);
List<Obs> obsList = ctx.getObsService().getObservations(persons, null, questionConcepts, null, null, null, null,
null, null, null, null, includeRetired);
null, null, null, null, includeVoided);
List<Attachment> attachments = new ArrayList<>();
for (Obs obs : obsList) {
@@ -77,15 +77,15 @@
}
@Override
public List<Attachment> getAttachments(Patient patient, Encounter encounter, boolean includeRetired) {
public List<Attachment> getAttachments(Patient patient, Encounter encounter, boolean includeVoided) {
List<Person> persons = new ArrayList<>();
List<Encounter> encounters = new ArrayList<>();
List<Concept> questionConcepts = getAttachmentConcepts();
persons.add(patient);
encounters.add(encounter);
List<Obs> obsList = ctx.getObsService().getObservations(persons, encounters, questionConcepts, null, null, null,
null, null, null, null, null, includeRetired);
null, null, null, null, null, includeVoided);
List<Attachment> attachments = new ArrayList<>();
for (Obs obs : obsList) {
@@ -98,15 +98,15 @@
}
@Override
public List<Attachment> getAttachments(Patient patient, final Visit visit, boolean includeRetired) {
public List<Attachment> getAttachments(Patient patient, final Visit visit, boolean includeVoided) {
List<Visit> visits = new ArrayList<>();
visits.add(visit);
List<Encounter> encounters = ctx.getEncounterService().getEncounters(patient, null, null, null, null, null, null,
null, visits, includeRetired);
null, visits, includeVoided);
List<Attachment> attachments = new ArrayList<>();
for (Encounter encounter : encounters) {
attachments.addAll(getAttachments(patient, encounter, includeRetired));
attachments.addAll(getAttachments(patient, encounter, includeVoided));
}
return attachments;
}

0 comments on commit 9095a67

Please sign in to comment.