/** * Returns a participant instance based on the specified CCOW context. */ @Override protected Participant fromCCOWContext(ContextItems contextItems) { Participant participant = null; try { participant = new Participant(); //TODO: Populate participant object from context items. return participant; } catch (Exception e) { log.error(e); return null; } }
/** * Gets the first repetition for <b>type</b> (), * creating it if it does not already exist. * * <p> * <b>Definition:</b> * Role of participant in encounter * </p> */ public BoundCodeableConceptDt<ParticipantTypeEnum> getTypeFirstRep() { if (getType().size() == 0) { addType(); } return getType().get(0); }
Encounter encounter = EncounterContext.getActiveEncounter(); IUser user = UserContext.getActiveUser(); Practitioner activePractitioner = (Practitioner) EncounterParticipantContext.getActivePractitioner().getIndividual() .getResource(); String practitionerId = activePractitioner == null ? null : activePractitioner.getId().getIdPart();
/** * Add a value for <b>type</b> () using an enumerated type. This * is intended as a convenience method for situations where the FHIR defined ValueSets are mandatory * or contain the desirable codes. If you wish to use codes other than those which are built-in, * you may also use the {@link #addType()} method. * * <p> * <b>Definition:</b> * Role of participant in encounter * </p> */ public BoundCodeableConceptDt<ParticipantTypeEnum> addType(ParticipantTypeEnum theValue) { BoundCodeableConceptDt<ParticipantTypeEnum> retVal = new BoundCodeableConceptDt<ParticipantTypeEnum>(ParticipantTypeEnum.VALUESET_BINDER, theValue); getType().add(retVal); return retVal; }
public static String getParticipantId(Participant participant) { return participant == null ? null : participant.getIndividual().getReference().getIdPart(); }
@Override public void renderItem(Listitem item, Object data) { Participant participant; if (data instanceof Participant) { participant = (Participant) data; } else if (data instanceof IResource) { participant = new Participant(); participant.setIndividual(new ResourceReferenceDt((IResource) data)); } else { return; } item.setValue(participant); createCell(item, FhirUtil.formatName(EncounterUtil.getName(participant))); item.setSclass(isPrimary(participant) ? Constants.SCLASS_PRIMARY : null); item.addForward(Events.ON_DOUBLE_CLICK, item.getListbox(), null); }
/** * Adds and returns a new value for <b>participant</b> () * * <p> * <b>Definition:</b> * The list of people responsible for providing the service * </p> */ public Participant addParticipant() { Participant newType = new Participant(); getParticipant().add(newType); return newType; }
public static boolean isPrepared(Encounter encounter) { return encounter != null && !encounter.getLocationFirstRep().isEmpty() && !encounter.getParticipantFirstRep().isEmpty() && getServiceCategory(encounter) != null; }
private static CodeableConceptDt findType(Participant participant, CodingDt participationType) { if (participant != null) { for (CodeableConceptDt tp : participant.getType()) { for (CodingDt coding : tp.getCoding()) { if (coding.getSystem().equals(participationType.getSystem()) && coding.getCode().equals(participationType.getCode())) { return tp; } } } } return null; }
public static HumanNameDt getName(Participant participant) { IBaseResource resource = ClientUtil.getResource(participant.getIndividual()); return resource instanceof Practitioner ? ((Practitioner) resource).getName() : resource instanceof RelatedPerson ? ((RelatedPerson) resource).getName() : null; }
public static Practitioner getPractitioner(Participant participant) { if (participant == null) { return null; } ResourceReferenceDt resource = participant.getIndividual(); IBaseResource ele = resource.getResource(); return ele instanceof Practitioner ? (Practitioner) ele : null; }
/** * Returns the current participant from the shared context if it is a practitioner. * * @return Current practitioner. */ public static Participant getActivePractitioner() { Participant participant = getParticipantContext().getContextObject(false); return participant == null ? null : participant.getIndividual().getResource() instanceof Practitioner ? participant : null; }
public static boolean removeType(Participant participant, CodingDt participationType) { CodeableConceptDt cpt; boolean found = false; while ((cpt = findType(participant, participationType)) != null) { participant.getType().remove(cpt); found = true; } return found; }
/** * Add a value for <b>type</b> () * * <p> * <b>Definition:</b> * Role of participant in encounter * </p> */ public BoundCodeableConceptDt<ParticipantTypeEnum> addType() { BoundCodeableConceptDt<ParticipantTypeEnum> retVal = new BoundCodeableConceptDt<ParticipantTypeEnum>(ParticipantTypeEnum.VALUESET_BINDER); getType().add(retVal); return retVal; }
private static boolean isProvider(Participant participant) { return participant != null && VistAUtil.getBrokerSession().callRPCBool("RGCWFUSR HASKEYS", "PROVIDER", participant.getIndividual().getReference().getIdPart()); }
@Override public int compare(Participant p1, Participant p2) { if (p1.getIndividual().getReference().equals(p2.getIndividual().getReference())) { return 0; } String n1 = FhirUtil.formatName(EncounterUtil.getName(p1)); String n2 = FhirUtil.formatName(EncounterUtil.getName(p2)); int i = n1.compareToIgnoreCase(n2); return i == 0 ? 1 : i; }
public static boolean addType(Participant participant, CodingDt participationType) { if (!hasType(participant, participationType)) { CodeableConceptDt cpt = participant.addType(); cpt.getCoding().add(participationType); return true; } return false; }