-
Notifications
You must be signed in to change notification settings - Fork 0
/
BazarCommands.txt
8789 lines (5557 loc) · 329 KB
/
BazarCommands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// table name for sequential number counter for tracked entity attribute
sequentialnumbercounter
SELECT id, owneruid, key, counter
FROM public.sequentialnumbercounter;
owneruid( means trackedentityattribute UID)
https://dhis2.org/downloads/archive/
https://dhis2.org/downloads/
https://github.com/dhis2/dhis2-utils/blob/master/resources/sql/upgrade-225.sql
https://releases.dhis2.org/2.25/dhis.war
// postgres 12 downloads link
https://www.postgresql.org/download/
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
//
sudo apt-get install p7zip
7za e myfiles.7z
/ used for plan
// unzip command
7zip file unzip
7z - e <file name>
// import database for plan
psql - p 5432 - h <host> - U <username > - d < database name > - f <. sql file >
// postgres database size query
SELECT pg_size_pretty( pg_database_size('mh_227_30_01_2021') );
SELECT pg_size_pretty( pg_database_size('myanmar_hmis_20_05_2021') );
SELECT pg_size_pretty( pg_database_size('hiv_tracker_234_18_06_2021') );
SELECT pg_size_pretty( pg_database_size('ippf_234_fpan_22_06_2021') );
SELECT pg_size_pretty( pg_database_size('icmr_nikushta_v228_23062021') ); // 1063 in 2.28
// create user on poatgres
CREATE USER fpaidbpro WITH PASSWORD fpaidbpro@9876;
ALTER USER fpidbpro WITH SUPERUSER;
GRANT ALL PRIVILEGES ON DATABASE fpaidb_pro to fpaidbpro;
CREATE USER fpidbpro WITH PASSWORD fpaidbpro@9876
ALTER USER fpidbpro WITH SUPERUSER;
GRANT ALL PRIVILEGES ON DATABASE fpaidb_pro to fpidbpro;
// give permisson to postgres user like /dhis/hmis
nano /etc/postgressql/13/main/pg_hba.cong
add
local all hmis md5openimisdemo_v233_09_04_2021
then ctrl + X then Y ( for saving )
then restart the postgres
and for database on another server add following in
nano /etc/postgressql/13/main/pg_hba.cong
host all all all all
host all all xxx.xxx.xxx.xxx md5
host all all all md5
And then restart the Service
connect to postgres through command line
psql -U postgres -h localhost
or go through to C:\Program Files\PostgreSQL\10\bin\psql.exe
list of database
\list or \l+
\d+ // for all tables for selected database
select version();
\! psql -V
// move to database
\connect dbname or \c dbname
\d+ // list of tables
and run the sql script as required
// connect on server linode
// login to postgres
sudo -s
su postgres
psql
// to connect the database
\c dbname username
psql dbname username
\c dmc dhis or \connect dbname username
\d+ // list of tables
and run the sql script as required
// ubantu server password update
// password update
sudo passwd username
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
or
passwd
Changing password for abhishek.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
https://developers.dhis2.org/
https://docs.dhis2.org/2.29/en/developer/html/dhis2_developer_manual_full.html#webapi_plugins
https://docs.dhis2.org/2.34/en/developer/html/webapi_plugins.html
https://jsfiddle.net/user/signup/
username -- mithilesh_thakur
password -- Mithilesh@123
e-mail -- [email protected]
// change owner of database
ALTER DATABASE emro_v233 owner to dhis;
// postgres restart
sudo /etc/init.d/postgresql restart
//post gis extension creation
create extension if not exists postgis;
// create extension for database
sudo -u postgres psql -c "create extension postgis;" dhis2
// ubantu file location
C:\Users\Mithilesh Thakur\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\home\mithilesh\dhis_report_app\reports-app
For reference, the safer way of getting the DHIS2 home directory from java is to call:
String getExternalDirectoryPath()
or
File getExternalDirectory()
from the LocationManager class.
Start a JAR Distribution
To start YouTrack JAR, run the command:
java -jar youtrack-<version>.jar
Copied!
Stop a JAR Distribution
To stop YouTrack JAR, in the console, press Ctrl+C or run this command in a separate console window:
java -jar youtrack-<version>.jar stop
for e-mail sending security enable
https://myaccount.google.com/u/1/lesssecureapps
host-name -- smtp.gmail.com
port -- 587
TSL - checked
new Date(0) is January 1, 1970 in UTC. Your timezone is not UTC.
Enviroment Variables as on 25/02/2020
System Variable
DHF_HOME -- c:\DHF_HOME
DHIS2_HOME -- C:\DHIS2_HOME
JAVA_HOME -- C:\Program Files\Java\jdk1.8.0_65
JAVA_OPTS -- -Xms1024m -Xmx1536m -XX:MaxPermSize=512m
M2_REPO -- C:\Users\Mithilesh Thakur\.m2
MAVEN_HOME -- C:\apache-maven-3.5.3
MAVEN_OPTS -- -Xms1024m -Xmx1536m -XX:MaxPermSize=512m
in side -- Path
add
C:\apache-maven-3.5.3\bin
select table_name from information_schema.tables where table_name like 'analytics%' and table_type = 'BASE TABLE'
app development workshop 29/10/2019 to 30/10/2019
//
Chaining the three methods together:
function reverseString(str) {
return str.split("").reverse().join("");
}
reverseString("hello");
https://github.com/amcgee/hisp-india-app-workshop master branch
dhis2.nu
runtime.dhis2.nu/#/
runtime.dhis2.nu/playground
https://github.com/dhis2/design-system
https://ui-core.dhis2.nu/
github.com/dhis2/design-system
yarn global add @dhis2/cli
or
npm install -- global @dhis2/cli
yarn add --peer @dhis2/ui-core
npm install react-scripts --save
// create new app
d2 app scripts init gis-manager
cd gis-manager
code .
yarn start
https://debug.dhis2.org/dev
select table_name from information_schema.tables where table_name like 'analytics%' and table_type = 'BASE TABLE'
select table_name from information_schema.tables where table_name like 'analytics_enrollment%' and table_type = 'BASE TABLE'
// get all orgUnit with all children
http://127.0.0.1:8090/dhis/api/organisationUnits/ANGhR1pa8I5.json?fields=id,displayName,code&includeDescendants=true&paging=false
http://172.105.47.158/intpart232/api/events.json?orgUnit=fMTeIPKpZbI&program=Nb2EygU6dwp&order=lastUpdated:asc&skipPaging=true&ouMode=DESCENDANTS
security training HISP-INDIA 22/08/2019
Firefox Lightbeam by mozilla add plugin
https://10minutemail.com/10MinuteMail/index.html
https://haveibeenpwned.com/
https://cybersafegirl.com
privacy Badger -- plugin
Threat Modelling
What do you want to protect ?
From whom do you want to protect it ?
How likely is that you need to protect it ?
How bad are the consequences of failure ?
How much trouble are you willing to go through ?
Welcome to Zoom
e-mail - [email protected]
Password Hygiene
Set Strong passwrds.
Do not share your passwords! Rule #1.
Set a password on your phone,laptop,computer
Use diffrent passwords
Change password often
Do not re-use passwords Use a password vault/manager,e.g.BitWarden LockWise
Verify Master Pasword
Passphrases
Easy to remember.
Hard for computers to guess.
eg. 2CatsRCrying
Use Diceware -- http://world.std.com/~reinhold/diceware.html
Two-Factor Authentication (2FA)
Prevent Malware Infection
Do not open unknow links.
Do not open unknow images or videos.
Do not download fiels from untrusted sources.
Don't use untrusted storage and devices (e.g Stuxnet ).
Update Everythings!.
Udate all software on all devices.
Check support duration for security updates before buying
Mind your permissions!
Do not use public WiFi.
torproject.org
tor -- browser is safe browser (tor network encrepted)
Mozilla Firefox
duckDuckGo! -- search engine
startpage
Encryption
Ciphers
Substitution Ciphers
https
FOSS ---
Signal Private Messenger WhatsApp use Signal Encraption ( End to End Encraption )
Facebook
WhatsApp
Instagram
telegram
haveibeenpwned.com
Warp Up!
Use common sense!
Do not share security credentials.
Invest for security.
Never stop learning!
security.sflc.in/dst40-ff
secutry.stackexchange.com
sflc.in
https://github.com/hispindia/dhis-tracker-capture-app/commits/ICMR_Leprosy_2.28
FRU -- GpEwBknDwF9
delivery-point -- FIaGENXR3c5
delivery point if Yes- fqM6fGLUqVD
nepali calendar change after 31/01/2019
// api/29/dataAnalysis/validationRules/report.xls
5590218502846345803063
083883
http://dhis2trainingland.com/eportal/?p=1766
ALTER SYSTEM SET default_transaction_read_only = off;
Select name, setting from pg_settings where name ='default_transation_read_only';
#default_transaction_read_only = off
Solution: Go >> C:\Program Files\PostgreSQL\11\share, open postgresql.conf and replaced default_transaction_read_only to off as `default_transaction_read_only = off`
Also here: C:\Program Files\PostgreSQL\11\data, open postgresql.conf and replaced default_transaction_read_only to off as `default_transaction_read_only = off`
In command line:
ALTER SYSTEM SET default_transaction_read_only = off;
See the result: Select name, setting from pg_settings where name ='default_transation_read_only';
See the result: Select name, setting from pg_settings where name ='default_transaction_read_only';
---------------------------------------------------------------------
user=# SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;
SET
user=# SHOW transaction_read_only;
transaction_read_only
-----------------------
on
(1 row)
location of file
C:\Program Files\PostgreSQL\10\data\ postgresql.conf
in side
#------------------------------------------------------------------------------
# LOCK MANAGEMENT
#------------------------------------------------------------------------------
#deadlock_timeout = 1s
max_locks_per_transaction = 100 # min 10
# (change requires restart)
#max_pred_locks_per_transaction = 64 # min 10
# (change requires restart)
#max_pred_locks_per_relation = -2 # negative values mean
# (max_pred_locks_per_transaction
# / -max_pred_locks_per_relation) - 1
#max_pred_locks_per_page = 2 # min 0
select setting from pg_settings where name= 'max_locks_per_transaction';
select setting,pending_restart from pg_settings where name= 'max_locks_per_transaction'; // set 200
select * from pg_settings
update pg_settings set setting = 100 where name= 'max_locks_per_transaction';
update pg_settings set setting = 200 where name= 'max_locks_per_transaction';
// trim and split string QUERY in postgresSQL
SELECT optionsetid,uid,code,TRIM(split_part(code, '-', 1)) from optionset where code Ilike '%awc%';
SELECT split_part('ordno-#-orddt-#-ordamt', '-#-', 2);
-- Install PostGIS extension
create extension if not exists postgis;
analytics tables generation script manually
bat file window
#!/bin/sh
curl "http://202.166.205.218/suaahara2/api/resourceTables/analytics?skipResourceTables=true&lastYears=2" -X POST -u admin:district
linex
analytics
#!/bin/sh
/usr/bin/curl "http://103.31.80.242:8080/greenstar_crm/api/resourceTables/analytics?skipResourceTables=true&lastYears=2" -X POST -u admin:district >/dev/null 2>&1
pg_dump -U postgres -d msf_23_07_2018 -T analytics* > C:\Users\HISP\Desktop\msf_updated_db.sql
pg_dump -U postgres -d msf_23_07_2018 -T analytics* -T datavalue -T datavalueaudit > C:\Users\HISP\Desktop\msf_updated_db.sql
http://localhost:8080/dhis
password reset in MY_SQL
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
// my-sql hispdev password code '56fca91da7db86434c23f579993ccbae' // Devhisp@1
// for HP-2.7
UPDATE users SET PASSWORD = '56fca91da7db86434c23f579993ccbae' WHERE username = 'hispdev';
update users set password = '59ef69feca1a172a17384b14a7a8529a' where username = 'admin'; // District1
MY-SQL District1 -- 59ef69feca1a172a17384b14a7a8529a
update users set password = '59ef69feca1a172a17384b14a7a8529a' where username = 'admin'; // District1
// for bihar 2.7
update users set password = '225194e60e0acc9dcf75dcd4ab9cd0c8' where username = 'neha'; // district
update users set password = '3953057518226a3411e96f3bf869c5a3' where username = 'neha'; // Devhisp@1
update users set password = '48e8f1207baef1ef7fe478a57d19f2e5' where username = 'admin'; // district
update users set password = '56fca91da7db86434c23f579993ccbae' where username = 'hispdev'; // Devhisp@1
My-sql
56fca91da7db86434c23f579993ccbae // Devhisp@1
59ef69feca1a172a17384b14a7a8529a // District1
59ef69feca1a172a17384b14a7a8529a
// postgres
dhis -- trunk
username -- hispdev
password -- $2a$10$FyFfOyfzQDKoJ6hs9Kr4WOfh7jp4H.LxMVQDcf1h4sJciYH1Y0meu -- Devhisp@1
username -- admin
password -- $2a$10$G33.vNKhKSfzixYbNsVB8epkcDqsWnxSkspfSBbI021X31mX/Av8G -- District@1
$2a$10$1YlO9QW/w93kOHJ3btJUqOjrm1/PXwYEmuz.BbsHcJNeh6RILI0PO -- Password@1
update users set password = '$2a$10$FyFfOyfzQDKoJ6hs9Kr4WOfh7jp4H.LxMVQDcf1h4sJciYH1Y0meu' where username = 'hispdev'; // Devhisp@1
update users set password = '$2a$10$ygJzpL.g054Z9RSPF1w6Y.SI3FhlqpPO4Hut690n6aHQG1BdvWKsa' where username = 'hispdev'; // district
update users set password = '$2a$10$ygJzpL.g054Z9RSPF1w6Y.SI3FhlqpPO4Hut690n6aHQG1BdvWKsa' where username = 'admin'; // district
update users set disabled = false where username = 'admin';
update users set password = '$2a$10$ygJzpL.g054Z9RSPF1w6Y.SI3FhlqpPO4Hut690n6aHQG1BdvWKsa' where username = 'DHIS2 SUPPORT'; // district
DHIS2 SUPPORT
set publicaccess = 'rw------' //for meta-data read write
set publicaccess = 'rwrw----' // for data and meta-data reade write
set publicaccess = 'r-rw----' //for meta-data read data read write
set publicaccess = 'r-r-----' // for data and meta-data read
dataset mera-data - read and data - read and write
update dataset set publicaccess = 'r-rw----';
rwrw---- // write access data and meta data 204275
update dataelementcategoryoption set publicaccess = 'rwrw----'
public access no access update dataset set publicaccess = '--------';
public access(view/edit) meta data read/write data reade ---- 'rwr-----'
public access(view/edit) meta data read/write data --- can/edit/view ----- rwrw----
public access(view/edit) meta data can edit and view ---- 'rw------'
update indicator set publicaccess = 'rw------' // for meta data can edit and view
update dataelementcategoryoption set publicaccess = 'rwrw----' where publicaccess = 'rwr-----';
// give publicaccess for meta-data read write where publicaccess none
update dataelement set publicaccess = 'rw------' where publicaccess = '--------';
update dataelement set publicaccess = 'rw------' where publicaccess = 'rwrw----';
update dataelement set publicaccess = 'rwrw----' where publicaccess = '--------';
// for optionSet only meta-data read and write access
update optionset set publicaccess = 'rw------' ;
select * from relationshipitem where programstageinstanceid in
( select programstageinstanceid from programstageinstance where deleted is true );
// api filter of dataSets attribute value
http://localhost:8091/libia/api/29/dataSets.json?fields=name,id,attributeValues[attribute[id,name],value],&filter=attributeValues.attribute.id:eq:c50z8yjWVTD
// postgres SQL Query alter the database sequence id
SELECT c.relname FROM pg_class c WHERE c.relkind = 'S';
SELECT last_value FROM hibernate_sequence;
ALTER SEQUENCE hibernate_sequence RESTART WITH 4412;
SELECT * FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'mapview';
SELECT * FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'map';
// for insert ' replace ' to '' in name coloumn
="update organisationunit set shortname = '"&F2&"' where uid = '"&D2&"';"
="update organisationunit set uid = '"&F2&"' where uid = '"&B2&"';"
="update organisationunit set featuretype = '"&F2&"', coordinates = '"&G2&"' where uid = '"&B2&"';"
="update organisationunit set name = '"&B2&"' where organisationunitid = "&A2&";"
="update organisationunit set name = '"&B2&"', shortname = '"&C2&"' where organisationunitid = "&A2&";"
="update datavalue set sourceid = "&B2&" where sourceid = "&A2&";"
update program_attributes set mandatory = true;
select * FROM public.program_attributes where mandatory is false;
="update users set password = '$2a$10$pB7gQ7nbMmLVExpua/8eHOLxweaZ.R11DJMWnrdWzLB0mpRoX5qYG' where username = '"&B2&"' and uid = '"&C2&"';"
="update users set password = '$2a$10$pB7gQ7nbMmLVExpua/8eHOLxweaZ.R11DJMWnrdWzLB0mpRoX5qYG' where username = '"&A2&"' and uid = '"&B2&"' and userid = "&C2&";"
select * from organisationunit where geometry is not null
select * from organisationunit where geometry is null
update organisationunit set geometry = null
update organisationunit set closeddate = null
="update attributevalue set value = '"&B2&"', lastupdated = '2018-11-30' where attributevalueid = "&C2&" and attributeid = "&D2&";"
="update dataelement set optionsetid = "&C2&" where uid = '"&A2&"';"
="update dataelement set code = '"&C1&"' where uid = '"&B1&"';"
="update dataelement set categorycomboid = "&D2&" where uid = '"&A2&"';"
="update dataelement set domaintype = '"&C2&"' where uid = '"&A2&"';"
="update dataelement set name = '"&B2&"' where uid = '"&A2&"';"
="update dataelement set name = '"&C2&"' where dataelementid = "&A2&" and uid = '"&B2&"';"
="update dataelement set name = '"&D2&"', shortname = '"&E2&"', formname = '"&F2&"', code = '"&C2&"' where dataelementid = "&A2&" and uid = '"&B2&"';"
="update dataelement set name = '"&B2&"', formname = '"&E2&"' where uid = '"&A2&"';"
="update dataelement set aggregationtype = '"&B2&"', valuetype = '"&C2&"' where uid = '"&A2&"';"
="update dataelement set name = '"&C2&"', valuetype = '"&D2&"' where dataelementid = "&A2&" and uid = '"&B2&"';"
="update optionset set code = '"&C2&"' where optionsetid = "&G2&";"
="update dataelementcategoryoption set code = '"&B2&"' where uid = '"&A2&"';"
="update dataelementcategoryoption set uid = '"&C2&"' where uid = '"&D2&"';"
="update dataelementcategoryoption set shortname = '"&D2&"' where categoryoptionid = "&A2&" and uid = '"&B2&"';"
="update programstagedataelement set sort_order = "&D2&" where programstagedataelementid = "&A2&" and dataelementid = "&C2&";"
="update programstageinstance set longitude = "&D2&", latitude = "&E2&" where programstageinstanceid = "&A2&" and organisationunitid = "&C2&";"
="update programinstance set programid = "&E2&" where programinstanceid = "&A2&" and uid = '"&B2&"' and organisationunitid = "&D2&";"
="update trackedentityprogramowner set programid = "&D2&" where trackedentityprogramownerid = "&A2&" and trackedentityinstanceid = "&B2&" and programid = "&C2&";"
="update programstageinstance set programstageid = "&F2&" where programstageinstanceid = "&A2&" and programinstanceid = "&C2&" and uid = '"&B2&"' and organisationunitid = "&E2&";"
insert into datavalue (dataelementid,periodid,sourceid,categoryoptioncomboid,attributeoptioncomboid,value,storedby,created,lastupdated,followup,deleted) values
="("&D2&","&G2&","&B2&","&E2&","&F2&",'"&C2&"','"&H2&"','2018-03-23','2018-03-23',false,false),"
update datavalue set created = now()::timestamp where created ='2019-02-13';
update datavalue set lastupdated = now()::timestamp where lastupdated ='2019-02-13';
// hp-2.7 datavalue insert query
INSERT INTO datavalue (dataelementid,periodid,sourceid,categoryoptioncomboid,VALUE,storedby,lastupdated,followup) VALUES
="("&A2&","&D2&","&B2&","&C2&",'"&E2&"','hispdev','2020-07-16',false),"
="update trackedentityattributevalue set value = '"&D2&"' where trackedentityinstanceid = "&B2&" and trackedentityattributeid = "&C2&";"
insert into trackedentityattributevalue (trackedentityinstanceid,trackedentityattributeid,created,lastupdated,value) values
="("&A2&",93,'2018-04-27','2018-04-27','"&C2&"'),"
insert into trackedentityattributevalue (trackedentityinstanceid,trackedentityattributeid,created,lastupdated,value,storedby) values
="("&B2&","&C2&",'2021-06-29','2021-06-29','"&D2&"','"&E2&"'),"
update trackedentityattributevalue set created = now()::timestamp where created = '2021-06-29';
update trackedentityattributevalue set lastupdated = now()::timestamp where lastupdated = '2021-06-29';
insert into trackedentityattributevalue (trackedentityinstanceid,trackedentityattributeid,created,lastupdated,value) values
="("&B2&",8374,'2020-01-31','2020-01-31','"&C2&"'),"
insert into trackedentityattributevalue (trackedentityinstanceid,trackedentityattributeid,created,lastupdated,value) values
(1455291,8374,'2020-04-22','2020-04-22','PLAN-EG-OIC-890335'),
(1455288,8374,'2020-04-22','2020-04-22','PLAN-EG-OIC-648230');
update trackedentityattributevalue set created = now()::timestamp where created = '2020-01-31';
update trackedentityattributevalue set lastupdated = now()::timestamp where lastupdated = '2020-01-31';
insert into period ( periodid, periodtypeid, startdate, enddate ) values
(nextval('hibernate_sequence'), 3, '2020-11-01', '2020-11-30');
="update trackedentityattributevalue set value = '"&A2&"' where trackedentityinstanceid = "&B2&" and trackedentityattributeid = "&C2&";"
insert into expression (expressionid, description, expression, slidingwindow, missingvaluestrategy ) values
="(nextval('hibernate_sequence'),'"&B2&"', '"&C2&"', '"&D2&"', '"&E2&"'),"
insert into dataset (datasetid, uid, created, lastupdated, name, shortname, periodtypeid, categorycomboid, publicaccess, version,expirydays,timelydays,openfutureperiods,fieldcombinationrequired,validcompleteonly,novaluerequirescomment,skipoffline,dataelementdecoration,renderastabs,renderhorizontally,compulsoryfieldscompleteonly,mobile,notifycompletinguser) values
="(nextval('hibernate_sequence'),'"&A2&"', '2021-03-02', '2021-03-02', '"&C2&"', '"&D2&"', 3, 14, 'rw------', 0,0,15,0,false,false,false,false,false,false,false,false,false,false),"
update dataset set created = now()::timestamp where created = '2021-02-20';
update dataset set lastupdated = now()::timestamp where lastupdated = '2021-02-20';
insert into datasetelement (datasetelementid, datasetid, dataelementid, categorycomboid ) values
="(nextval('hibernate_sequence'),"&A2&", "&B2&","&C2&"),"
insert into datainputperiod (datainputperiodid, periodid, datasetid ) values
="(nextval('hibernate_sequence'),"&B2&", "&A2&"),"
insert into datasetindicators ( indicatorid, datasetid ) values
="( "&A2&", "&B2&"),"
insert into datasetsource sourceid,datasetid) values
="( "&A2&", "&B2&"),"
="update dataset set dataentryform = "&C2&" where datasetid = "&B2&";"
insert into dataelement (dataelementid, uid, created, lastupdated, lastupdatedby, name, shortname, valuetype, domaintype, aggregationtype, categorycomboid, zeroissignificant, userid, publicaccess) values
="(nextval('hibernate_sequence'),'"&B2&"', '2018-12-19', '2018-12-19', 50, '"&C2&"','"&D2&"','INTEGER_ZERO_OR_POSITIVE','AGGREGATE','SUM',"&I2&",'TRUE',50,'rw------'),"
insert into dataelement (dataelementid, uid, created, lastupdated, lastupdatedby, name, shortname, formname, valuetype, domaintype, aggregationtype, categorycomboid, zeroissignificant, userid, publicaccess) values
="(nextval('hibernate_sequence'),'"&B2&"', '2020-06-03', '2020-06-03', 58, '"&A2&"','"&C2&"','"&D2&"','"&F2&"','"&E2&"','"&G2&"',21,false,58,'rw------'),"
insert into dataelement (dataelementid, uid, created, lastupdated, name, shortname, valuetype, domaintype, aggregationtype, categorycomboid, zeroissignificant, publicaccess) values
="(nextval('hibernate_sequence'),'"&B2&"', '2020-10-16', '2020-10-16', '"&D2&"','"&E2&"','"&F2&"','"&G2&"','"&H2&"',"&J2&",'"&K2&"','rw------'),"
update dataelement set created = now()::timestamp where created = '2020-06-03';
update dataelement set lastupdated = now()::timestamp where lastupdated = '2020-06-03';
insert into programinstance (programinstanceid, uid, created, lastupdated, incidentdate, enrollmentdate, followup, status, programid, deleted ) values
="(nextval('hibernate_sequence'),'Hp8x7f6RKXQ', '2020-11-16', '2020-11-16', '2020-11-16', '2020-11-16', false, 'ACTIVE', 87786995, false),"
update programinstance set created = now()::timestamp where created = '2020-11-16';
update programinstance set lastupdated = now()::timestamp where lastupdated = '2020-11-16';
update programinstance set incidentdate = now()::timestamp where incidentdate = '2020-11-16';
update programinstance set enrollmentdate = now()::timestamp where enrollmentdate = '2020-11-16';
insert into predictor ( predictorid, uid, created, lastupdated, name, generatorexpressionid, generatoroutput, periodtypeid, sequentialsamplecount,annualsamplecount, generatoroutputcombo ) values
="(nextval('hibernate_sequence'),'"&B2&"', '2020-10-22', '2020-10-22', '"&C2&"',"&D2&","&E2&","&F2&","&G2&","&H2&"),"
update predictor set created = now()::timestamp where created = '2020-10-22';
update predictor set lastupdated = now()::timestamp where lastupdated = '2020-10-22';
insert into programrulevariable (programrulevariableid,uid,created,lastupdated,name,programid,sourcetype,usecodeforoptionset) values
="(nextval('hibernate_sequence'),'"&A2&"', '2020-04-23', '2020-04-23','"&D2&"',"&C2&",'"&E2&"',false),"
insert into programrulevariable (programrulevariableid,uid,created,lastupdated,name,programid,sourcetype,usecodeforoptionset,dataelementid) values
="(nextval('hibernate_sequence'),'"&A2&"', '2020-04-23', '2020-04-23','"&D2&"',"&C2&",'"&E2&"',false, "&G2&"),"
update programrulevariable set created = now()::timestamp where created ='2020-04-23';
update programrulevariable set lastupdated = now()::timestamp where lastupdated ='2020-04-23';
insert into programrule (programruleid,uid,created,lastupdated,name,programid,rulecondition,priority) values
="(nextval('hibernate_sequence'),'"&C2&"', '2020-04-29', '2020-04-29','"&E2&"',"&D2&",'"&F2&"',"&G2&"),"
update programrule set created = now()::timestamp where created ='2020-04-29';
update programrule set lastupdated = now()::timestamp where lastupdated ='2020-04-29';
insert into programruleaction (programruleactionid,uid,created,lastupdated,actiontype,programruleid,content, data) values
="(nextval('hibernate_sequence'),'"&J2&"', '2020-04-29', '2020-04-29','"&K2&"',"&I2&",'"&L2&"','"&M2&"'),"
update programruleaction set created = now()::timestamp where created ='2020-04-29';
update programruleaction set lastupdated = now()::timestamp where lastupdated ='2020-04-29';
insert into dataelement (dataelementid, uid, created, lastupdated, name, shortname, valuetype, domaintype, aggregationtype, categorycomboid, zeroissignificant, publicaccess) values
="(nextval('hibernate_sequence'),'"&B2&"', '2020-04-28', '2020-04-28','"&E2&"','"&H2&"','"&J2&"','AGGREGATE','SUM',19,'TRUE','rw------'),"
insert into dataelement (dataelementid, uid, created, lastupdated, lastupdatedby, name, shortname, formname, valuetype, domaintype, aggregationtype, categorycomboid, zeroissignificant, userid, publicaccess) values
="(nextval('hibernate_sequence'),'"&B2&"', '2020-05-27', '2020-05-27', 56, '"&A2&"','"&D2&"','"&F2&"', 'INTEGER_ZERO_OR_POSITIVE','AGGREGATE','SUM',"&L2&",true,56,'rw------'),"
update dataelement set created = now()::timestamp where created ='2020-05-27';
update dataelement set lastupdated = now()::timestamp where lastupdated ='2020-05-27';
insert into categories_categoryoptions(categoryoptionid,categoryid,sort_order) values
="("&C2&","&D2&","&E2&"),"
insert into indicator (indicatorid, created, lastupdated, lastupdatedby, name, shortname, annualized, indicatortypeid, numerator,numeratordescription, denominator, denominatordescription, userid, publicaccess) values
="(nextval('hibernate_sequence'), '2019-06-04', '2019-06-04', 50, '"&A2&"','"&B2&"',false,"&H2&",'"&D2&"','"&C2&"', '"&F2&"','"&E2&"', 50,'rw------'),"
update indicator set created = now()::timestamp where created ='2019-03-19';
update indicator set lastupdated = now()::timestamp where lastupdated ='2019-03-19';
insert into indicator (indicatorid, uid, created, lastupdated, name, shortname, annualized, indicatortypeid, numerator, numeratordescription, denominator, denominatordescription, decimals, publicaccess) values
="(nextval('hibernate_sequence'), '"&B2&"', '2020-10-15', '2020-10-15', '"&C2&"','"&D2&"', false, "&E2&",'"&G2&"', '"&H2&"','"&I2&"', '"&J2&"', "&K2&", 'rw------'),"
update indicator set created = now()::timestamp where created ='2020-10-15';
update indicator set lastupdated = now()::timestamp where lastupdated ='2020-10-15';
insert into indicatorgroupmembers (indicatorid,indicatorgroupid) values
="("&A2&","&B2&"),"
insert into programinstance (programinstanceid, created, lastupdated, incidentdate, enrollmentdate, followup, status, trackedentityinstanceid, programid, organisationunitid, createdatclient, lastupdatedatclient, deleted, storedby) values
="(nextval('hibernate_sequence'),'2019-07-04','2019-07-04','2019-07-04','2019-07-04','false','ACTIVE',"&A2&","&C2&","&B2&", '2019-07-04','2019-07-04','false','maricel.mendina'),"
INSERT INTO programindicator(programindicatorid, uid, created, lastupdated, name, shortname, programid, expression, filter, aggregationtype, analyticstype,publicaccess) VALUES
="(nextval('hibernate_sequence'),'"&A2&"','2019-12-20','2019-12-20','"&B2&"','"&C2&"','"&H2&"','"&F2&"','"&G2&"','"&D2&"','"&E2&"','"&I2&"'),"
INSERT INTO programindicator(programindicatorid, uid, created, lastupdated, name, shortname, programid, expression, filter, aggregationtype, analyticstype,publicaccess) VALUES
="(nextval('hibernate_sequence'),'"&A2&"','2020-02-06','2020-02-06','"&B2&"','"&C2&"',"&H2&",'"&F2&"','"&G2&"','"&D2&"','"&E2&"','rw------'),"
INSERT INTO programindicator(programindicatorid, uid, created, lastupdated, name, shortname, programid, expression, filter, aggregationtype, analyticstype,publicaccess) VALUES
="(nextval('hibernate_sequence'),'"&A2&"','2020-04-09','2020-04-09','"&B2&"','"&C2&"',"&D2&",'"&E2&"','"&F2&"','"&G2&"','"&H2&"','rw------'),"
INSERT INTO programindicator(programindicatorid, uid, created, lastupdated, name, shortname, programid, expression, filter, aggregationtype, decimals, displayinform, analyticstype,publicaccess) VALUES
="(nextval('hibernate_sequence'),'"&B2&"','2021-02-26','2021-02-26','"&F2&"','"&G2&"',"&H2&",'"&I2&"','"&J2&"','"&K2&"',"&L2&",'"&M2&"','"&N2&"','"&P2&"'),"
update programindicator set created = now()::timestamp where created ='2021-02-26';
update programindicator set lastupdated = now()::timestamp where lastupdated ='2021-02-26';
update programindicator set decimals = null where decimals = 0;
INSERT INTO periodboundary(periodboundaryid, uid, created, lastupdated, boundarytarget, analyticsperiodboundarytype, programindicatorid ) VALUES
="(nextval('hibernate_sequence'),'"&A2&"','2020-02-06','2020-02-06','"&C2&"','"&D2&"',"&A2&"),"
update periodboundary set created = now()::timestamp where created ='2020-02-06';
update periodboundary set lastupdated = now()::timestamp where lastupdated ='2020-02-06';
update programindicator set created = now()::timestamp where created ='2020-02-06';
update programindicator set lastupdated = now()::timestamp where lastupdated ='2020-02-06';
="update dataelement set code = '"&C2&"' where uid = '"&B2&"';"
="update dataelement set uid = '"&E2&"' where uid = '"&C2&"';"
="update programindicator set name = '"&C2&"', shortname = '"&D2&"', expression = '"&H2&"', filter = '"&I2&"', aggregationtype = '"&E2&"', analyticstype = '"&K2&"' where programindicatorid = "&B2&" and uid = '"&A2&"';"
="update users set password = '"&C2&"' where username = '"&B2&"' and uid = '"&A2&"';"
insert into attributevalue (attributevalueid,created, lastupdated, value, attributeid ) values
="(nextval('hibernate_sequence'),'2019-01-14','2019-01-14','"&B2&"',38115164),"
update attributevalue set created = now()::timestamp where created ='2019-01-14';
update attributevalue set lastupdated = now()::timestamp where lastupdated ='2019-01-14';
insert into keyjsonvalue (keyjsonvalueid,created, lastupdated, namespace, namespacekey ) values
="(nextval('hibernate_sequence'),'2019-02-26','2019-02-26','"&A2&"','"&B2&"'),"
update keyjsonvalue set created = now()::timestamp where created ='2019-02-01';
update keyjsonvalue set lastupdated = now()::timestamp where lastupdated ='2019-02-01';
insert into organisationunitattributevalues ( organisationunitid, attributevalueid ) values
="("&C2&","&F2&"),"
insert into datasetusergroupaccesses (datasetid,usergroupaccessid) values
="("&A2&","&B2&"),"
insert into completedatasetregistration (datasetid, periodid, sourceid, attributeoptioncomboid, date, storedby) values
="("&A2&","&B2&","&C2&","&D2&",'2019-09-27','hisp'),"
="update completedatasetregistration set date = '"&E2&"', storedby = '"&F2&"', lastupdatedby = '"&G2&"', lastupdated = '"&H2&"', completed = '"&I2&"' where datasetid = "&A2&" and periodid = "&B2&" and sourceid = "&C2&" and attributeoptioncomboid = "&D2&";"
insert into completedatasetregistration (datasetid, periodid, sourceid, attributeoptioncomboid, date, storedby,lastupdatedby,lastupdated,completed) values
="("&A2&","&B2&","&C2&","&F2&",'"&D2&"','"&E2&"','"&G2&"','"&H2&"','"&I2&"'),"
insert into userrolemembers (userroleid,userid) values
="("&D2&","&A2&"),"
insert into userdatavieworgunits ( userinfoid, organisationunitid ) values
="("&A2&","&B2&"),"
insert into userteisearchorgunits ( userinfoid, organisationunitid ) values
="("&H2&","&F2&"),"
insert into usergroupmembers (userid,usergroupid) values
="("&A2&","&B2&"),"
insert into datasetusergroupaccesses ( datasetid, usergroupaccessid ) values
="("&B2&","&D2&"),"
insert into organisationunit (organisationunitid,name,shortname,parentid,openingdate,created,lastupdated,hierarchylevel) values
="(nextval('hibernate_sequence'),'"&C2&"','"&C2&"',"&B2&",'1990-01-01','2018-03-20','2018-03-20',3),"
insert into organisationunit (organisationunitid,uid,name,shortname,code,parentid,openingdate,created,lastupdated,hierarchylevel) values
="(nextval('hibernate_sequence'),'"&C2&"','"&B2&"','"&B2&"','"&D2&"',"&F2&",'1990-01-01','2020-06-23','2020-06-23',"&E2&"),"
insert into organisationunit (organisationunitid,uid,name,shortname,parentid,openingdate,created,lastupdated,hierarchylevel) values
="(nextval('hibernate_sequence'),'"&C2&"','"&A2&"','"&B2&"',"&E2&",'1990-01-01','2020-01-27','2020-01-27',"&D2&"),"
insert into organisationunit (organisationunitid,uid,code,name,shortname,parentid,openingdate,created,lastupdated,hierarchylevel,featuretype) values
="(nextval('hibernate_sequence'),'"&E2&"','"&F2&"','"&G2&"','"&H2&"',"&D2&",'"&J2&"','2018-05-25','2018-05-25',"&I2&",'"&K2&"' ),"
insert into organisationunit (organisationunitid,name,shortname,parentid,openingdate,created,lastupdated,hierarchylevel) values
="(nextval('hibernate_sequence'),'"&A2&"','"&A2&"',"&E2&",'1987-05-18','2020-09-14','2020-09-14',"&G2&"),"
insert into organisationunit (organisationunitid,uid,code,name,shortname,parentid,openingdate,created,lastupdated,hierarchylevel,featuretype, coordinates) values
="(nextval('hibernate_sequence'),'"&E2&"','"&F2&"','"&G2&"','"&H2&"',"&D2&",'"&J2&"','2018-05-29','2018-05-29',"&I2&",'"&K2&"', '"&M2&"'),"
insert into organisationunit (organisationunitid,uid, name,shortname,parentid,openingdate,created,lastupdated,hierarchylevel) values
="(nextval('hibernate_sequence'),'"&B2&"','"&A2&"','"&A2&"',"&E2&",'1987-05-18','2020-09-14','2020-09-14',"&G2&"),"
="update organisationunit set featuretype = '"&G2&"', coordinates = '"&H2&"' where organisationunitid = "&C2&";"
insert into orgunitgroup (orgunitgroupid,uid,name,shortname,created,lastupdated,publicaccess) values
="(nextval('hibernate_sequence'),'"&A2&"','"&B2&"','"&C2&"','2021-02-25','2021-02-25','"&D2&"'),"
update orgunitgroup set created = now()::timestamp where created ='2021-02-25';
update orgunitgroup set lastupdated = now()::timestamp where lastupdated ='2021-02-25';
insert into orgunitgroupmembers (organisationunitid, orgunitgroupid ) values
="( "&D2&", "&A2&" ),"
insert into orgunitgroupset (orgunitgroupsetid,uid,name,description,created,lastupdated,compulsory, includesubhierarchyinanalytics, datadimension,publicaccess) values
="(nextval('hibernate_sequence'),'"&A2&"','"&B2&"','"&C2&"','2021-02-25','2021-02-25','"&D2&"','"&E2&"','"&F2&"','"&G2&"'),"
update orgunitgroupset set created = now()::timestamp where created ='2021-02-25';
update orgunitgroupset set lastupdated = now()::timestamp where lastupdated ='2021-02-25';
insert into orgunitgroupsetmembers (orgunitgroupid, orgunitgroupsetid ) values
="( "&G2&", "&H2&" ),"
="update programinstance set enrollmentdate = '"&B2&"' where trackedentityattributeid in( select trackedentityinstanceid from trackedentityattributevalue where value = '"&C2&"' );"
="update programinstance set enrollmentdate = '"&B2&"' where programid in ( select programid from program where uid = 'EZkN8vYZwjR ') and trackedentityattributeid in( select trackedentityinstanceid from trackedentityattributevalue where value = '"&C2&"' );"
update organisationunit set created = now()::timestamp where created ='2018-12-14';
update organisationunit set lastupdated = now()::timestamp where lastupdated ='2018-12-14';
update organisationunit set created = now()::timestamp where created ='2018-12-13';
update organisationunit set lastupdated = now()::timestamp where lastupdated ='2018-12-13';
select * from organisationunit where translations = '[]';
update programindicator set lastupdated = now()::timestamp where lastupdated ='2018-12-06';
update datavalue set created = now()::timestamp where created is null;
="update trackedentityattributevalue set value = '"&D2&"', lastupdated = '2018-12-31' where trackedentityattributeid = "&B2&" and trackedentityinstanceid = "&A2&";"
update trackedentityattributevalue set lastupdated = now()::timestamp where lastupdated = '2018-12-31';
update trackedentityattributevalue set created = now()::timestamp where created = '2018-07-03';
update trackedentityattributevalue set lastupdated = now()::timestamp where lastupdated = '2018-07-03';
="update organisationunit set name = '"&C2&"', shortname = '"&C2&"' where organisationunitid = "&B2&";"
="update organisationunit set name = '"&B2&"', shortname = '"&C2&"' where uid = '"&A2&"';"
insert into dataelement (dataelementid, created, lastupdated,name, shortname, formname, valuetype, domaintype, aggregationtype, categorycomboid, zeroissignificant, optionsetid, publicaccess) values
="(nextval('hibernate_sequence'),'2018-10-03','2018-10-03', '"&A2&"','"&C2&"','"&D2&"','"&F2&"','"&E2&"','"&G2&"',"&H2&",'false',"&L2&", 'rw------'),"
update dataelement set created = now()::timestamp where created = '2020-09-29';
update dataelement set lastupdated = now()::timestamp where lastupdated = '2020-09-29';
insert into optionset (optionsetid, uid, code, created, lastupdated, lastupdatedby name, valuetype, userid, publicaccess) values
="(nextval('hibernate_sequence'),'"&B2&"','"&C2&"','2019-06-12','2019-06-12',57,'"&A2&"','TEXT',57,'rw------'),"
insert into trackedentitydatavalue (programstageinstanceid, dataelementid, value, created, lastupdated,providedelsewhere, storedby ) values
="("&C2&","&E2&",'"&D2&"','2019-01-14','2019-01-14',false,'admin'),"