openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/api/repository/PatientRepository.java
/**
     * Add encounters.
     *
     * @param patient the patient
     */
Add encounters.
@param patient the patient
Add encounters . @param patient the patient
public void addEncounters(Patient patient) {
        EncounterCreateRoomDAO dao = db.encounterCreateRoomDAO();
        String enc = patient.getEncounters();
        List<Long> list = new ArrayList<>();
        for (String s : enc.split(","))
            list.add(Long.parseLong(s));
        for (long id : list) {
            Encountercreate encountercreate = dao.getCreatedEncountersByID(id);
            encountercreate.setPatient(patient.getUuid());
            dao.updateExistingEncounter(encountercreate);
            new EncounterService().addEncounter(encountercreate);
        }
    }
public void addEncounters ( Patient patient ) { EncounterCreateRoomDAO dao = db . encounterCreateRoomDAO ( ) ; String enc = patient . getEncounters ( ) ; List < Long > list = new ArrayList < > ( ) ; for ( String s : enc . split ( "," ) ) list . add ( Long . parseLong ( s ) ) ; for ( long id : list ) { Encountercreate encountercreate = dao . getCreatedEncountersByID ( id ) ; encountercreate . setPatient ( patient . getUuid ( ) ) ; dao . updateExistingEncounter ( encountercreate ) ; new EncounterService ( ) . addEncounter ( encountercreate ) ; } }
Add encounters.
Add encounters .