Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 3914

Show
Ignore:
Timestamp:
04/14/08 17:44:16 (9 months ago)
Author:
tmdugan
Message:

-- chica

* pull location from encounter instead of using Unknown location

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs-modules/chica/src/org/openmrs/module/chica/util/Util.java

    r3815 r3914  
    1616import org.openmrs.module.atd.hibernateBeans.FormAttributeValue; 
    1717import org.openmrs.module.atd.service.ATDService; 
     18import org.openmrs.module.chica.hibernateBeans.Encounter; 
    1819import org.openmrs.module.chica.service.EncounterService; 
    1920 
     
    149150                        obs.setValueText(value); 
    150151                } 
    151  
    152                 EncounterService encounterService = (EncounterService) Context 
    153                                .getService(EncounterService.class); 
    154                 Location location = encounterService 
    155                                .getLocationByName("Unknown Location"); 
     152                 
     153                EncounterService encounterService = (EncounterService) Context.getService(EncounterService.class); 
     154                Encounter encounter = (Encounter) encounterService.getEncounter(encounterId); 
     155                 
     156                Location location = encounter.getLocation(); 
    156157                obs.setObsDatetime(new java.util.Date()); 
    157158                obs.setPerson(patient); 
    158159                obs.setConcept(currConcept); 
    159160                obs.setLocation(location); 
    160                 obs.setEncounter(encounterService.getEncounter(encounterId)); 
     161                obs.setEncounter(encounter); 
    161162                obsService.createObs(obs); 
    162163        }