← Back to team overview

dhis2-devs team mailing list archive

Về: SMS Command Single Event

 

Hi Snorre ,

It's seem to me that you're using the dhis-api to get the list of ProgramStageDataElement . Why don't you just use the normal program service to get the Program object and from that you can easily get the ProgramStageDataElement list.

Long
 

________________________________
Ngo Thanh Long
HISP Vietnam


________________________________
 Từ: Snorre Olimstad <snorro@xxxxxxxxxx>
Tới: dhis2-devs@xxxxxxxxxxxxxxxxxxx 
Đã gửi 5:49 Thứ Tư, 25 tháng 9 2013
Chủ đề: [Dhis2-devs]  SMS Command Single Event
 


Hi.

I'm working on registration of single events through SMS, but I struck a problem and hope somebody can help me.

In 2.12 you can create a SMS command connected to a dataset, then edit the command and create codes that is tied to the data elements. Single event is not connected to data sets, but to programs. I can now create a commands that is connected to a program instead of a dataset, but when I go to edit the data elements in the program does not show, so I can't create any codes in the command.

I guess it has something to do with that /dhis-api/dataelement is connected to datasets, but not to programs. 
Programs has kind of their own datalement-methods in /dhis-api/program.

Any idea or tips on how I can import the programs data elements in edit-sms-command.vm would be much appreciated!


- Snorre Olimstad



PS: This is the current code that import the data elements into edit-sms-command.vm: 

#foreach( $dataElement in $dataElements)
#if ($dataElement.categoryCombo && $dataElement.categoryCombo.sortedOptionCombos) 
          #foreach($x in $dataElement.categoryCombo.sortedOptionCombos)    
              #set ($str = ""+$dataElement.id+""+$x.id)
               <tr>
                          <td>
                               $dataElement.name $x.name
                          </td>
                          <td>
                               <input type="text" name="$dataElement.id.$x.id" value='$!codes[$str]' class="validate">
                          </td>
                     </tr>
                #end
        #else
        <tr>
           <td>$dataElement.name</td>
           <td><input type="text" name="$dataElement.id"></td>   
        </tr>         
        #end  
#end
_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

References