You also need to include programStage: {} in your programStageDataElement,
we are reusing this objekt in multiple places.. so its hard to make a
generic importer for it.. hopefully we will convert it to a proper idObject
in the future, right now it uses a composite key (dataElement, programStage)-- Morten On Tue, Jun 17, 2014 at 2:34 PM, Mahendra Kariya < [email protected]> wrote: > Hi Tran, > Thanks! It's working with the latest build. > > > Hi Morten, > Program stage section creation is still not working. We are hitting > /api/metadata endpoint. > Could you please look into this? > > > *Input:* > { > "programStageSections": [ > { > "programStageDataElements": [ > { > "displayInReports": false, > "dataElement": { > "id": "ac52ed2bd5d", > "name": "Date" > }, > "allowProvidedElsewhere": false, > "compulsory": false, > "allowDateInFuture": false > } > ], > "name": "name2", > "sortOrder": 1, > "programStage": { > "id": "b17f8e7729b" > } > } > ] > } > > > *Error:* > > Caused by: org.h2.jdbc.JdbcSQLException: NULL not allowed for column > "PROGRAMSTAGEID"; SQL statement: > insert into programstage_dataelements (compulsory, allowprovidedelsewhere, > sort_order, displayInReports, allowDateInFuture, programstageid, > dataelementid) values (?, ?, ?, ?, ?, ?, ?) [23502-173] > > > > > Thanks, > Mahendra > > > On Mon, Jun 16, 2014 at 12:27 PM, Tran Chau <[email protected]> > wrote: > >> Hi Morten, >> >> I looked the bug : >> >> "We created a Program say "Program1" and then "Program Stage" under it. >> This stage has approximately 20 "ProgramStageDataElements". >> >> On "Event Capture screen", after selecting relevant fields ("Program1" as >> program and "orgUnit" as organization Unit), on clicking "Register Event", >> I am able to see only few "ProgramStageDataElements" (around 10) and not >> all of them." >> >> .......... >> It doesn't occur on demo side and my side. I tested with revision *15144*, >> version 2.15. Maybe it was fixed before.... >> >> >> Best regards, >> ------------------------------------------------ >> Châu Thu Trân >> HISP Viet Nam >> Email: [email protected] >> >> >> On Thu, Jun 12, 2014 at 5:34 PM, Morten Olav Hansen <[email protected]> >> wrote: >> >>> That sounds weird. Abyor or Tran, could you have a look at it? >>> >>> -- >>> Morten >>> >>> >>> On Thu, Jun 12, 2014 at 11:26 AM, Mansi Singhal < >>> [email protected]> wrote: >>> >>>> Hey Morten, >>>> >>>> Thanks for that. >>>> >>>> I just wanted a clarification on one more thing: >>>> >>>> We created a Program say "Program1" and then "Program Stage" under it. >>>> This stage has approximately 20 "ProgramStageDataElements". >>>> >>>> On "Event Capture screen", after selecting relevant fields ("Program1" >>>> as program and "orgUnit" as organization Unit), on clicking "Register >>>> Event", I am able to see only few "ProgramStageDataElements" (around 10) >>>> and not all of them. >>>> >>>> Is it the expected behavior or its a bug? >>>> >>>> >>>> >>>> On Thu, Jun 12, 2014 at 2:28 PM, Morten Olav Hansen <[email protected] >>>> > wrote: >>>> >>>>> Hi, >>>>> >>>>> The tracker metadata web-api should still be considered wip (it's new >>>>> for 2.16). I haven't tested with programStageSections at all. >>>>> >>>>> I will have a look at it. >>>>> >>>>> -- >>>>> Morten >>>>> >>>>> >>>>> On Thu, Jun 12, 2014 at 10:49 AM, Mansi Singhal < >>>>> [email protected]> wrote: >>>>> >>>>>> Hello All, >>>>>> >>>>>> We were trying to create "Program", "Program Stage" and "Program >>>>>> Stage Section" using "/metadata" api. >>>>>> >>>>>> We are facing issues creating "Program Stage Section". >>>>>> *Status : 409 Conflict* >>>>>> >>>>>> When we tried debugging the issue, we got some ClassCastExceptions >>>>>> for "List to Set" and "Set to List" in "extractProgramStageDataElements" >>>>>> and "saveProgramStageDataElements" methods in >>>>>> "DefaultIdentifiableObjectImporter" class under "dhis-services-dxf2". >>>>>> >>>>>> We tried fixing it, and we got some more exceptions (Constraint >>>>>> Violation Exception) >>>>>> >>>>>> *Input to the api "/metadata"*: >>>>>> >>>>>> { >>>>>> "programStageSections": [ >>>>>> { >>>>>> "name": "SomeName", >>>>>> "programStageDataElements": [ >>>>>> { >>>>>> "allowDateInFuture": false, >>>>>> "allowProvidedElsewhere": false, >>>>>> "compulsory": false, >>>>>> "dataElement": { >>>>>> "id": "DataElementId", >>>>>> "name": "DataElementName" >>>>>> }, >>>>>> "displayInReports": false >>>>>> } >>>>>> ], >>>>>> "sortOrder": 1 >>>>>> } >>>>>> ] >>>>>> } >>>>>> >>>>>> Can you please have a look onto this and fix it if needed. >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Thanks, >>>>>> Mansi Singhal >>>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Regards, >>>> Mansi Singhal >>>> >>>> >>> >> >
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : [email protected] Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp

