diff --git a/tests/data_generator/datagenerator.go b/tests/data_generator/datagenerator.go index d6c1110..0a71e66 100644 --- a/tests/data_generator/datagenerator.go +++ b/tests/data_generator/datagenerator.go @@ -293,21 +293,21 @@ func AddObservationForPerson(conceptId int64, concept Concept, personId int64) { result := tests.ExecSQLString( fmt.Sprintf( "INSERT into %s.observation "+ - "(observation_id,person_id,observation_concept_id,value_as_concept_id,value_as_number,observation_date,observation_datetime,observation_type_concept_id) "+ + "(person_id,observation_concept_id,value_as_concept_id,value_as_number,observation_date,observation_datetime,observation_type_concept_id) "+ "values "+ - "(%d,%d,%d,%s,%s,'2000-01-01','2000-01-01 00:00:00',0)", + "(%d,%d,%s,%s,'2000-01-01','2000-01-01 00:00:00',0)", tests.GetOmopDataSourceForSourceId(sourceId).Schema, - lastObservationId+1, personId, conceptId, valueAsConceptId, valueAsNumber), + personId, conceptId, valueAsConceptId, valueAsNumber), sourceId) if result.Error != nil { // fallback, try simpler record without explicitly setting observation_id: tests.ExecSQLStringOrFail(fmt.Sprintf( "INSERT into %s.observation "+ - "(person_id,observation_concept_id,value_as_concept_id,value_as_number,observation_date,observation_datetime,observation_type_concept_id) "+ + "(observation_id,person_id,observation_concept_id,value_as_concept_id,value_as_number,observation_date,observation_datetime,observation_type_concept_id) "+ "values "+ - "(%d,%d,%s,%s,'2000-01-01','2000-01-01 00:00:00',0)", + "(%d,%d,%d,%s,%s,'2000-01-01','2000-01-01 00:00:00',0)", tests.GetOmopDataSourceForSourceId(sourceId).Schema, - personId, conceptId, valueAsConceptId, valueAsNumber), + lastObservationId+1, personId, conceptId, valueAsConceptId, valueAsNumber), sourceId) } @@ -315,21 +315,21 @@ func AddObservationForPerson(conceptId int64, concept Concept, personId int64) { result = tests.ExecSQLString( fmt.Sprintf( "INSERT into %s.observation_period "+ - "(observation_period_id,person_id,observation_period_start_date,observation_period_end_date,period_type_concept_id) "+ + "(person_id,observation_period_start_date,observation_period_end_date,period_type_concept_id) "+ "values "+ - "(%d,%d,'1999-01-01','2099-01-01',0)", + "(%d,'1999-01-01','2099-01-01',0)", tests.GetOmopDataSourceForSourceId(sourceId).Schema, - lastObservationId+1, personId), + personId), sourceId) if result.Error != nil { // fallback, try simpler record without explicitly setting observation_id: tests.ExecSQLStringOrFail(fmt.Sprintf( "INSERT into %s.observation_period "+ - "(person_id,observation_period_start_date,observation_period_end_date,period_type_concept_id) "+ + "(observation_period_id,person_id,observation_period_start_date,observation_period_end_date,period_type_concept_id) "+ "values "+ - "(%d,'1999-01-01','2099-01-01',0)", + "(%d,%d,'1999-01-01','2099-01-01',0)", tests.GetOmopDataSourceForSourceId(sourceId).Schema, - personId), + lastObservationId+1, personId), sourceId) } lastObservationId++