├── .gitignore ├── src ├── .gitignore ├── dev.mac ├── DSWMap │ └── Utils.cls ├── ID │ ├── Region.cls │ ├── Parameter.cls │ ├── Area.cls │ ├── ParameterValue.cls │ ├── Utils.cls │ └── BI │ │ └── IDCube.cls ├── BG │ ├── Region.cls │ ├── Parameter.cls │ ├── Area.cls │ ├── ParameterValue.cls │ └── BI │ │ └── BGCube.cls ├── CZ │ ├── Region.cls │ ├── Parameter.cls │ ├── Area.cls │ ├── ParameterValue.cls │ └── BI │ │ └── CZCube.cls ├── KZ │ ├── Region.cls │ ├── Parameter.cls │ ├── Area.cls │ ├── ParameterValue.cls │ └── BI │ │ └── KZCube.cls ├── SE │ ├── Region.cls │ ├── Parameter.cls │ ├── Area.cls │ ├── ParameterValue.cls │ └── BI │ │ └── SECube.cls ├── UA │ ├── Region.cls │ ├── Parameter.cls │ ├── Area.cls │ ├── ParameterValue.cls │ └── BI │ │ └── UACube.cls ├── UK │ ├── Region.cls │ ├── Parameter.cls │ ├── Area.cls │ ├── ParameterValue.cls │ └── BI │ │ └── UKCube.cls ├── RSA │ ├── Region.cls │ ├── Parameter.cls │ ├── Area.cls │ ├── ParameterValue.cls │ └── BI │ │ └── RSACube.cls ├── RF │ ├── SAKH │ │ ├── Utils.cls │ │ ├── Region.cls │ │ └── SAKHCube.cls │ ├── PERM │ │ ├── Parameter.cls │ │ ├── Region.cls │ │ ├── ParameterValue.cls │ │ └── BI │ │ │ └── PERMCube.cls │ ├── Parameter.cls │ ├── KHAB │ │ ├── Region.cls │ │ ├── BI │ │ │ └── KHABCube.cls │ │ └── Utils.cls │ ├── ParameterValue.cls │ └── Region.cls ├── FIN │ ├── Parameter.cls │ ├── Region.cls │ ├── Area.cls │ ├── ParameterValue.cls │ └── BI │ │ └── FINCube.cls ├── UA21 │ ├── District.cls │ ├── Region.cls │ └── BI │ │ └── UA21Cube.cls ├── USA │ ├── City.cls │ ├── BI │ │ └── Elections.cls │ ├── Elections.cls │ ├── Parameter.cls │ ├── Area.cls │ ├── ParameterValue.cls │ ├── Region.cls │ └── Borders.cls ├── World │ └── Countries.cls ├── gbl │ └── DeepSee.TermList.xml ├── js │ └── idpolygons.js └── dfi │ ├── Russia │ ├── Map.dashboard.xml │ ├── Map of Perm Krai.dashboard.xml │ └── Map of Khabarovsk krai.dashboard.xml │ ├── UA21 │ ├── UA21-population.dashboard.xml │ ├── population.dashboard.xml │ ├── population.pivot.xml │ └── UA21-population.pivot.xml │ ├── BG │ └── Map of Bulgaria.dashboard.xml │ ├── FIN │ └── FinMap.dashboard.xml │ ├── UK │ └── UKMap.dashboard.xml │ ├── UA │ └── Map of Ukraina.dashboard.xml │ ├── CZ │ └── CzMap.dashboard.xml │ ├── SE │ └── SeMap.dashboard.xml │ ├── RSA │ └── RsaMap.dashboard.xml │ ├── ID │ ├── Map of Indonesia.dashboard.xml │ └── Population Map Mini Dist.pivot.xml │ ├── KZ │ ├── Map of Kazakhstan.dashboard.xml │ └── Population Map Mini Dist.pivot.xml │ ├── USA │ ├── Elections.dashboard.xml │ ├── USA Map Standard.dashboard.xml │ ├── USMapDensity.pivot.xml │ └── Indicator.pivot.xml │ ├── SAKH │ ├── Indicator.pivot.xml │ └── Map.pivot.xml │ └── KHAB │ └── Indicator.pivot.xml ├── .dockerignore ├── data └── ElectionsD.gof ├── .gitattributes ├── docker-compose.yml ├── .github └── workflows │ ├── build-push-gcr.yaml │ ├── objectscript-quality.yml │ └── bump-module-version.yml ├── .vscode ├── launch.json └── settings.json ├── LICENSE ├── iris.script ├── Dockerfile ├── README.md ├── module.xml └── dev.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS* -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | .DS* -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | **/.DS_Store 2 | .git -------------------------------------------------------------------------------- /data/ElectionsD.gof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intersystems-community/dsw-map/master/data/ElectionsD.gof -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sh text eol=lf 2 | *.cls text eol=lf 3 | *.mac text eol=lf 4 | *.int text eol=lf 5 | Dockerfil* text eol=lf -------------------------------------------------------------------------------- /src/dev.mac: -------------------------------------------------------------------------------- 1 | // classes release export 2 | s list="CZ*.CLS,FIN*.CLS,RF*.CLS,RSA*.CLS,SE*.CLS,USA*.CLS,World*.CLS,*.DFI" 3 | D $System.OBJ.Export(list,"dsw-map-release"_$tr($zd($h,3),"-","")_".xml") 4 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.6' 2 | services: 3 | iris: 4 | build: 5 | context: . 6 | dockerfile: Dockerfile 7 | restart: always 8 | command: --check-caps false 9 | ports: 10 | - 51773 11 | - 52773 12 | - 53773 13 | volumes: 14 | - ./:/home/irisowner/irisdev/ 15 | -------------------------------------------------------------------------------- /.github/workflows/build-push-gcr.yaml: -------------------------------------------------------------------------------- 1 | name: Cloud Run Deploy 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - main 8 | workflow_dispatch: 9 | 10 | jobs: 11 | deploy: 12 | uses: intersystems-community/demo-deployment/.github/workflows/deployment.yml@master 13 | with: 14 | name: dswmap 15 | secrets: 16 | SERVICE_ACCOUNT_KEY: ${{ secrets.SERVICE_ACCOUNT_KEY }} 17 | -------------------------------------------------------------------------------- /.github/workflows/objectscript-quality.yml: -------------------------------------------------------------------------------- 1 | name: objectscriptquality 2 | on: push 3 | 4 | jobs: 5 | linux: 6 | name: Linux build 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - name: Execute ObjectScript Quality Analysis 11 | run: wget https://raw.githubusercontent.com/litesolutions/objectscriptquality-jenkins-integration/master/iris-community-hook.sh && sh ./iris-community-hook.sh 12 | 13 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "objectscript", 6 | "request": "launch", 7 | "name": "ObjectScript Debug Class", 8 | "program": "##class(PackageSample.ObjectScript).Test()", 9 | }, 10 | { 11 | "type": "objectscript", 12 | "request": "attach", 13 | "name": "ObjectScript Attach", 14 | "processId": "${command:PickProcess}", 15 | "system": true 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /src/DSWMap/Utils.cls: -------------------------------------------------------------------------------- 1 | Class DSWMap.Utils 2 | { 3 | 4 | ClassMethod SetupAll() 5 | { 6 | 7 | for map="CZ","FIN","RSA","SE","RF.SAKH","RF.KHAB","USA","UK","KZ","UA","UA21","RF.PERM","BG", "ID" { 8 | do $CLASSMETHOD(map_".Utils", "Setup") 9 | } 10 | } 11 | 12 | ClassMethod EnableAnalytics() As %Status 13 | { 14 | set namespace = $ZNspace 15 | set app = $System.CSP.GetDefaultApp(namespace) _ "/" 16 | 17 | try { 18 | do EnableDeepSee^%SYS.cspServer(app) 19 | } catch (ex) { 20 | set tSC=ex.AsStatus() 21 | write !,"WARNING: failed to enable DeepSee for "_namespace_" namespace." 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | 4 | "Dockerfile*": "dockerfile", 5 | "iris.script": "objectscript" 6 | }, 7 | "objectscript.conn" :{ 8 | "ns": "USER", 9 | "active": true, 10 | "docker-compose": { 11 | "service": "iris", 12 | "internalPort": 52773 13 | }, 14 | "username": "_SYSTEM", 15 | "password": "SYS", 16 | "links": { 17 | "SAMPLES BI in ZEN": "http://localhost:${port}/csp/irisapp/_DeepSee.UserPortal.DashboardViewer.zen", 18 | "SAMPLES BI in DSW": "http://localhost:${port}/dsw/index.html#/USER" 19 | } 20 | } 21 | 22 | 23 | } -------------------------------------------------------------------------------- /src/ID/Region.cls: -------------------------------------------------------------------------------- 1 | Class ID.Region Extends Area 2 | { 3 | 4 | /// Parent of region. For state=null, for county=state 5 | Relationship ParentRegion As Region(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = ChildrenRegions ]; 6 | 7 | /// Region childrens. For state=counties, for county=0 8 | Relationship ChildrenRegions As Region [ Cardinality = many, Inverse = ParentRegion ]; 9 | 10 | Index ParentRegionIdx On ParentRegion; 11 | 12 | Storage Default 13 | { 14 | 15 | "Region" 16 | 17 | ParentRegion 18 | 19 | 20 | RegionDefaultData 21 | %Storage.Persistent 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/BG/Region.cls: -------------------------------------------------------------------------------- 1 | Class BG.Region Extends Area 2 | { 3 | 4 | /// Parent of region. For state=null, for county=state 5 | Relationship ParentRegion As Region(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = ChildrenRegions ]; 6 | 7 | /// Region childrens. For state=counties, for county=0 8 | Relationship ChildrenRegions As Region [ Cardinality = many, Inverse = ParentRegion ]; 9 | 10 | Index ParentRegionIdx On ParentRegion; 11 | 12 | Storage Default 13 | { 14 | 15 | "Region" 16 | 17 | ParentRegion 18 | 19 | 20 | RegionDefaultData 21 | %Storage.Persistent 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/CZ/Region.cls: -------------------------------------------------------------------------------- 1 | Class CZ.Region Extends Area 2 | { 3 | 4 | /// Parent of region. For state=null, for county=state 5 | Relationship ParentRegion As Region(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = ChildrenRegions ]; 6 | 7 | /// Region childrens. For state=counties, for county=0 8 | Relationship ChildrenRegions As Region [ Cardinality = many, Inverse = ParentRegion ]; 9 | 10 | Index ParentRegionIdx On ParentRegion; 11 | 12 | Storage Default 13 | { 14 | 15 | "Region" 16 | 17 | ParentRegion 18 | 19 | 20 | RegionDefaultData 21 | %Storage.Persistent 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/KZ/Region.cls: -------------------------------------------------------------------------------- 1 | Class KZ.Region Extends Area 2 | { 3 | 4 | /// Parent of region. For state=null, for county=state 5 | Relationship ParentRegion As Region(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = ChildrenRegions ]; 6 | 7 | /// Region childrens. For state=counties, for county=0 8 | Relationship ChildrenRegions As Region [ Cardinality = many, Inverse = ParentRegion ]; 9 | 10 | Index ParentRegionIdx On ParentRegion; 11 | 12 | Storage Default 13 | { 14 | 15 | "Region" 16 | 17 | ParentRegion 18 | 19 | 20 | RegionDefaultData 21 | %Storage.Persistent 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/SE/Region.cls: -------------------------------------------------------------------------------- 1 | Class SE.Region Extends Area 2 | { 3 | 4 | /// Parent of region. For state=null, for county=state 5 | Relationship ParentRegion As Region(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = ChildrenRegions ]; 6 | 7 | /// Region childrens. For state=counties, for county=0 8 | Relationship ChildrenRegions As Region [ Cardinality = many, Inverse = ParentRegion ]; 9 | 10 | Index ParentRegionIdx On ParentRegion; 11 | 12 | Storage Default 13 | { 14 | 15 | "Region" 16 | 17 | ParentRegion 18 | 19 | 20 | RegionDefaultData 21 | %Storage.Persistent 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/UA/Region.cls: -------------------------------------------------------------------------------- 1 | Class UA.Region Extends Area 2 | { 3 | 4 | /// Parent of region. For state=null, for county=state 5 | Relationship ParentRegion As Region(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = ChildrenRegions ]; 6 | 7 | /// Region childrens. For state=counties, for county=0 8 | Relationship ChildrenRegions As Region [ Cardinality = many, Inverse = ParentRegion ]; 9 | 10 | Index ParentRegionIdx On ParentRegion; 11 | 12 | Storage Default 13 | { 14 | 15 | "Region" 16 | 17 | ParentRegion 18 | 19 | 20 | RegionDefaultData 21 | %Storage.Persistent 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/UK/Region.cls: -------------------------------------------------------------------------------- 1 | Class UK.Region Extends Area 2 | { 3 | 4 | /// Parent of region. For state=null, for county=state 5 | Relationship ParentRegion As Region(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = ChildrenRegions ]; 6 | 7 | /// Region childrens. For state=counties, for county=0 8 | Relationship ChildrenRegions As Region [ Cardinality = many, Inverse = ParentRegion ]; 9 | 10 | Index ParentRegionIdx On ParentRegion; 11 | 12 | Storage Default 13 | { 14 | 15 | "Region" 16 | 17 | ParentRegion 18 | 19 | 20 | RegionDefaultData 21 | %Storage.Persistent 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/RSA/Region.cls: -------------------------------------------------------------------------------- 1 | Class RSA.Region Extends Area 2 | { 3 | 4 | /// Parent of region. For state=null, for county=state 5 | Relationship ParentRegion As Region(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = ChildrenRegions ]; 6 | 7 | /// Region childrens. For state=counties, for county=0 8 | Relationship ChildrenRegions As Region [ Cardinality = many, Inverse = ParentRegion ]; 9 | 10 | Index ParentRegionIdx On ParentRegion; 11 | 12 | Storage Default 13 | { 14 | 15 | "Region" 16 | 17 | ParentRegion 18 | 19 | 20 | RegionDefaultData 21 | %Storage.Persistent 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/RF/SAKH/Utils.cls: -------------------------------------------------------------------------------- 1 | Class RF.SAKH.Utils 2 | { 3 | 4 | ClassMethod Setup() 5 | { 6 | do ..Populate() 7 | do ##class(%DeepSee.Utils).%BuildCube("SAKHCube",0) 8 | } 9 | 10 | ClassMethod Populate() 11 | { 12 | for i="Невельский район","Южно-Сахалинск","Поронайский район","Александровск-Сахалинский район","Охинский район","Углегорский район","Холмский район","Корсаковский район","Томаринский район","Южно-Курильский район","Смирныховский район","Анивский район","Ногликский район","Долинский район","Тымовский район","Макаровский район","Северо-Курильский район","Курильский район" 13 | { 14 | set obj=##class(RF.SAKH.Region).%New() 15 | set obj.Name=i 16 | set obj.Population=$R(100000) 17 | d obj.%Save() 18 | w obj.Name," created",! 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/ID/Parameter.cls: -------------------------------------------------------------------------------- 1 | Class ID.Parameter Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Property Name As %String; 5 | 6 | Property UnitName As %String; 7 | 8 | Relationship Values As ParameterValue [ Cardinality = many, Inverse = Parameter ]; 9 | 10 | Storage Default 11 | { 12 | 13 | 14 | %%CLASSNAME 15 | 16 | 17 | Name 18 | 19 | 20 | UnitName 21 | 22 | 23 | ^ID.ParameterD 24 | ParameterDefaultData 25 | ^ID.ParameterD 26 | ^ID.ParameterI 27 | ^ID.ParameterS 28 | %Storage.Persistent 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/BG/Parameter.cls: -------------------------------------------------------------------------------- 1 | Class BG.Parameter Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Property Name As %String; 5 | 6 | Property UnitName As %String; 7 | 8 | Relationship Values As ParameterValue [ Cardinality = many, Inverse = Parameter ]; 9 | 10 | Storage Default 11 | { 12 | 13 | 14 | %%CLASSNAME 15 | 16 | 17 | Name 18 | 19 | 20 | UnitName 21 | 22 | 23 | ^BG.ParameterD 24 | ParameterDefaultData 25 | ^BG.ParameterD 26 | ^BG.ParameterI 27 | ^BG.ParameterS 28 | %Storage.Persistent 29 | } 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/CZ/Parameter.cls: -------------------------------------------------------------------------------- 1 | Class CZ.Parameter Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Property Name As %String; 5 | 6 | Property UnitName As %String; 7 | 8 | Relationship Values As ParameterValue [ Cardinality = many, Inverse = Parameter ]; 9 | 10 | Storage Default 11 | { 12 | 13 | 14 | %%CLASSNAME 15 | 16 | 17 | Name 18 | 19 | 20 | UnitName 21 | 22 | 23 | ^CZ.ParameterD 24 | ParameterDefaultData 25 | ^CZ.ParameterD 26 | ^CZ.ParameterI 27 | ^CZ.ParameterS 28 | %Storage.Persistent 29 | } 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/KZ/Parameter.cls: -------------------------------------------------------------------------------- 1 | Class KZ.Parameter Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Property Name As %String; 5 | 6 | Property UnitName As %String; 7 | 8 | Relationship Values As ParameterValue [ Cardinality = many, Inverse = Parameter ]; 9 | 10 | Storage Default 11 | { 12 | 13 | 14 | %%CLASSNAME 15 | 16 | 17 | Name 18 | 19 | 20 | UnitName 21 | 22 | 23 | ^KZ.ParameterD 24 | ParameterDefaultData 25 | ^KZ.ParameterD 26 | ^KZ.ParameterI 27 | ^KZ.ParameterS 28 | %Storage.Persistent 29 | } 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/SE/Parameter.cls: -------------------------------------------------------------------------------- 1 | Class SE.Parameter Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Property Name As %String; 5 | 6 | Property UnitName As %String; 7 | 8 | Relationship Values As ParameterValue [ Cardinality = many, Inverse = Parameter ]; 9 | 10 | Storage Default 11 | { 12 | 13 | 14 | %%CLASSNAME 15 | 16 | 17 | Name 18 | 19 | 20 | UnitName 21 | 22 | 23 | ^SE.ParameterD 24 | ParameterDefaultData 25 | ^SE.ParameterD 26 | ^SE.ParameterI 27 | ^SE.ParameterS 28 | %Storage.Persistent 29 | } 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/UA/Parameter.cls: -------------------------------------------------------------------------------- 1 | Class UA.Parameter Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Property Name As %String; 5 | 6 | Property UnitName As %String; 7 | 8 | Relationship Values As ParameterValue [ Cardinality = many, Inverse = Parameter ]; 9 | 10 | Storage Default 11 | { 12 | 13 | 14 | %%CLASSNAME 15 | 16 | 17 | Name 18 | 19 | 20 | UnitName 21 | 22 | 23 | ^UA.ParameterD 24 | ParameterDefaultData 25 | ^UA.ParameterD 26 | ^UA.ParameterI 27 | ^UA.ParameterS 28 | %Storage.Persistent 29 | } 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/UK/Parameter.cls: -------------------------------------------------------------------------------- 1 | Class UK.Parameter Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Property Name As %String; 5 | 6 | Property UnitName As %String; 7 | 8 | Relationship Values As ParameterValue [ Cardinality = many, Inverse = Parameter ]; 9 | 10 | Storage Default 11 | { 12 | 13 | 14 | %%CLASSNAME 15 | 16 | 17 | Name 18 | 19 | 20 | UnitName 21 | 22 | 23 | ^UK.ParameterD 24 | ParameterDefaultData 25 | ^UK.ParameterD 26 | ^UK.ParameterI 27 | ^UK.ParameterS 28 | %Storage.Persistent 29 | } 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/RSA/Parameter.cls: -------------------------------------------------------------------------------- 1 | Class RSA.Parameter Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Property Name As %String; 5 | 6 | Property UnitName As %String; 7 | 8 | Relationship Values As ParameterValue [ Cardinality = many, Inverse = Parameter ]; 9 | 10 | Storage Default 11 | { 12 | 13 | 14 | %%CLASSNAME 15 | 16 | 17 | Name 18 | 19 | 20 | UnitName 21 | 22 | 23 | ^RSA.ParameterD 24 | ParameterDefaultData 25 | ^RSA.ParameterD 26 | ^RSA.ParameterI 27 | ^RSA.ParameterS 28 | %Storage.Persistent 29 | } 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/FIN/Parameter.cls: -------------------------------------------------------------------------------- 1 | Class FIN.Parameter Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Property Name As %String; 5 | 6 | Property UnitName As %String; 7 | 8 | Relationship Values As FIN.ParameterValue [ Cardinality = many, Inverse = Parameter ]; 9 | 10 | Storage Default 11 | { 12 | 13 | 14 | %%CLASSNAME 15 | 16 | 17 | Name 18 | 19 | 20 | UnitName 21 | 22 | 23 | ^FIN.ParameterD 24 | ParameterDefaultData 25 | ^FIN.ParameterD 26 | ^FIN.ParameterI 27 | ^FIN.ParameterS 28 | %Storage.Persistent 29 | } 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/RF/PERM/Parameter.cls: -------------------------------------------------------------------------------- 1 | Class RF.PERM.Parameter Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Property Name As %String; 5 | 6 | Property UnitName As %String; 7 | 8 | Relationship Values As ParameterValue [ Cardinality = many, Inverse = Parameter ]; 9 | 10 | Storage Default 11 | { 12 | 13 | 14 | %%CLASSNAME 15 | 16 | 17 | Name 18 | 19 | 20 | UnitName 21 | 22 | 23 | ^RF.PERM.ParameterD 24 | ParameterDefaultData 25 | ^RF.PERM.ParameterD 26 | ^RF.PERM.ParameterI 27 | ^RF.PERM.ParameterS 28 | %Storage.Persistent 29 | } 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/RF/Parameter.cls: -------------------------------------------------------------------------------- 1 | /// Параметер 2 | Class RF.Parameter Extends (%Persistent, %XML.Adaptor) 3 | { 4 | 5 | /// Имя параметра 6 | Property Name As %String [ Required ]; 7 | 8 | /// Имя единицы измерения 9 | Property UnitName As %String [ Required ]; 10 | 11 | Storage Default 12 | { 13 | 14 | 15 | %%CLASSNAME 16 | 17 | 18 | Name 19 | 20 | 21 | UnitName 22 | 23 | 24 | ^RF.ParameterD 25 | ParameterDefaultData 26 | 100000 27 | ^RF.ParameterD 28 | ^RF.ParameterI 29 | ^RF.ParameterS 30 | %Storage.Persistent 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/RF/KHAB/Region.cls: -------------------------------------------------------------------------------- 1 | Class RF.KHAB.Region Extends %Persistent 2 | { 3 | 4 | Property Key As %String; 5 | 6 | Property Name As %String; 7 | 8 | Property Population As %Integer; 9 | 10 | Index KeyIdx On Key [ IdKey, Unique ]; 11 | 12 | Storage Default 13 | { 14 | 15 | 16 | %%CLASSNAME 17 | 18 | 19 | Key 20 | 21 | 22 | Name 23 | 24 | 25 | Population 26 | 27 | 28 | ^RF.KHAB.RegionD 29 | RegionDefaultData 30 | ^RF.KHAB.RegionD 31 | ^RF.KHAB.RegionI 32 | ^RF.KHAB.RegionS 33 | %Storage.Persistent 34 | } 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/UA21/District.cls: -------------------------------------------------------------------------------- 1 | Class UA21.District Extends %Persistent 2 | { 3 | 4 | Property name As %String(MAXLEN = 250); 5 | 6 | Property population As %Integer; 7 | 8 | Property guid As %String; 9 | 10 | Property region As Region; 11 | 12 | Storage Default 13 | { 14 | 15 | 16 | %%CLASSNAME 17 | 18 | 19 | name 20 | 21 | 22 | population 23 | 24 | 25 | guid 26 | 27 | 28 | region 29 | 30 | 31 | ^UA21.DistrictD 32 | DistrictDefaultData 33 | ^UA21.DistrictD 34 | ^UA21.DistrictI 35 | ^UA21.DistrictS 36 | %Storage.Persistent 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /src/USA/City.cls: -------------------------------------------------------------------------------- 1 | Class USA.City Extends Area 2 | { 3 | 4 | /// County 5 | Relationship Region As Region(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Cities ]; 6 | 7 | /// 1 - capital of state or county, 0-ordinary city 8 | Property SpecialIcon As %Boolean [ Required ]; 9 | 10 | Property Latitude As %Float [ Required ]; 11 | 12 | Property Longitude As %Float [ Required ]; 13 | 14 | Index RegionIdx On Region; 15 | 16 | Storage Default 17 | { 18 | 19 | "City" 20 | 21 | Region 22 | 23 | 24 | Latitude 25 | 26 | 27 | Longitude 28 | 29 | 30 | SpecialIcon 31 | 32 | 33 | CityDefaultData 34 | %Storage.Persistent 35 | } 36 | 37 | } 38 | 39 | -------------------------------------------------------------------------------- /.github/workflows/bump-module-version.yml: -------------------------------------------------------------------------------- 1 | name: versionbump 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - main 8 | pull_request: 9 | branches: 10 | - master 11 | - main 12 | release: 13 | types: 14 | - released 15 | 16 | jobs: 17 | build: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: actions/checkout@v2 21 | - name: Bump version 22 | run: | 23 | git config --global user.name 'ProjectBot' 24 | git config --global user.email 'bot@users.noreply.github.com' 25 | VERSION=$(sed -n '0,/.*\(.*\)<\/Version>.*/s//\1/p' module.xml) 26 | VERSION=`echo $VERSION | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.` 27 | sed -i "0,/\(.*\)<\/Version>/s//$VERSION<\/Version>/" module.xml 28 | git add module.xml 29 | git commit -m 'auto bump version' 30 | git push 31 | -------------------------------------------------------------------------------- /src/FIN/Region.cls: -------------------------------------------------------------------------------- 1 | /// State or county 2 | Class FIN.Region Extends Area 3 | { 4 | 5 | /// Parent of region. For state=null, for county=state 6 | Relationship ParentRegion As Region(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = ChildrenRegions ]; 7 | 8 | /// Region childrens. For state=counties, for county=0 9 | Relationship ChildrenRegions As Region [ Cardinality = many, Inverse = ParentRegion ]; 10 | 11 | Index ParentRegionIdx On ParentRegion; 12 | 13 | Storage Default 14 | { 15 | 16 | "Region" 17 | 18 | Capital 19 | 20 | 21 | DefaultZoom 22 | 23 | 24 | HLevel 25 | 26 | 27 | ParentRegion 28 | 29 | 30 | RegionDefaultData 31 | %Storage.Persistent 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/USA/BI/Elections.cls: -------------------------------------------------------------------------------- 1 | Class USA.Elections Extends %Persistent 2 | { 3 | 4 | Property RegionName As %String; 5 | 6 | Property Guid As %String; 7 | 8 | Property Trump As %Integer; 9 | 10 | Property Clinton As %Integer; 11 | 12 | Index GuidIdx On Guid [ Unique ]; 13 | 14 | Storage Default 15 | { 16 | 17 | 18 | %%CLASSNAME 19 | 20 | 21 | RegionName 22 | 23 | 24 | Guid 25 | 26 | 27 | Trump 28 | 29 | 30 | Clinton 31 | 32 | 33 | ^USA.ElectionsD 34 | ElectionsDefaultData 35 | ^USA.ElectionsD 36 | ^USA.ElectionsI 37 | ^USA.ElectionsS 38 | %Library.CacheStorage 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/USA/Elections.cls: -------------------------------------------------------------------------------- 1 | Class USA.Elections Extends %Persistent 2 | { 3 | 4 | Property RegionName As %String; 5 | 6 | Property Guid As %String; 7 | 8 | Property Trump As %Integer; 9 | 10 | Property Clinton As %Integer; 11 | 12 | Index GuidIdx On Guid [ Unique ]; 13 | 14 | Storage Default 15 | { 16 | 17 | 18 | %%CLASSNAME 19 | 20 | 21 | RegionName 22 | 23 | 24 | Guid 25 | 26 | 27 | Trump 28 | 29 | 30 | Clinton 31 | 32 | 33 | ^USA.ElectionsD 34 | ElectionsDefaultData 35 | ^USA.ElectionsD 36 | ^USA.ElectionsI 37 | ^USA.ElectionsS 38 | %Storage.Persistent 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/UA21/Region.cls: -------------------------------------------------------------------------------- 1 | Class UA21.Region Extends %Persistent 2 | { 3 | 4 | Property name As %String(MAXLEN = 250); 5 | 6 | Property guid As %String; 7 | 8 | Index nameIndex On name; 9 | 10 | ClassMethod getId(name, guid = "") As %Integer 11 | { 12 | if '..nameIndexExists(name, .id) { 13 | set obj = ..%New() 14 | set obj.name = name 15 | set obj.guid = guid 16 | $$$TOE(sc,obj.%Save()) 17 | set id = obj.%Id() 18 | } 19 | quit id 20 | } 21 | 22 | Storage Default 23 | { 24 | 25 | 26 | %%CLASSNAME 27 | 28 | 29 | name 30 | 31 | 32 | guid 33 | 34 | 35 | ^UA21.RegionD 36 | RegionDefaultData 37 | ^UA21.RegionD 38 | ^UA21.RegionI 39 | ^UA21.RegionS 40 | %Storage.Persistent 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/RF/PERM/Region.cls: -------------------------------------------------------------------------------- 1 | Class RF.PERM.Region Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | /// Name of the Region 5 | Property Name As %String(MAXLEN = 500) [ Required ]; 6 | 7 | /// Guid for polygons in js file 8 | Property Guid As %String(MAXLEN = "") [ Required ]; 9 | 10 | /// All values 11 | Relationship Parameters As ParameterValue [ Cardinality = many, Inverse = Region ]; 12 | 13 | Index GuidIdx On Guid [ IdKey, Unique ]; 14 | 15 | Storage Default 16 | { 17 | 18 | 19 | %%CLASSNAME 20 | 21 | 22 | Name 23 | 24 | 25 | DataUrl 26 | 27 | 28 | ^RF.PERM.RegionD 29 | RegionDefaultData 30 | ^RF.PERM.RegionD 31 | ^RF.PERM.RegionI 32 | ^RF.PERM.RegionS 33 | %Storage.Persistent 34 | } 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/ID/Area.cls: -------------------------------------------------------------------------------- 1 | Class ID.Area Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | /// Name of the Region 5 | Property Name As %String(MAXLEN = 500) [ Required ]; 6 | 7 | /// Guid for polygons in js file 8 | Property Guid As %String [ Required ]; 9 | 10 | /// Link to Wiki article 11 | Property DataUrl As %String(MAXLEN = 500); 12 | 13 | /// All values 14 | Relationship Parameters As ParameterValue [ Cardinality = many, Inverse = Region ]; 15 | 16 | Index GuidIdx On Guid [ IdKey, Unique ]; 17 | 18 | Storage Default 19 | { 20 | 21 | 22 | %%CLASSNAME 23 | 24 | 25 | Name 26 | 27 | 28 | DataUrl 29 | 30 | 31 | ^ID.AreaD 32 | AreaDefaultData 33 | ^ID.AreaD 34 | ^ID.AreaI 35 | ^ID.AreaS 36 | %Storage.Persistent 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/BG/Area.cls: -------------------------------------------------------------------------------- 1 | Class BG.Area Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | /// Name of the Region 5 | Property Name As %String(MAXLEN = 500) [ Required ]; 6 | 7 | /// Guid for polygons in js file 8 | Property Guid As %String [ Required ]; 9 | 10 | /// Link to Wiki article 11 | Property DataUrl As %String(MAXLEN = 500); 12 | 13 | /// All values 14 | Relationship Parameters As ParameterValue [ Cardinality = many, Inverse = Region ]; 15 | 16 | Index GuidIdx On Guid [ IdKey, Unique ]; 17 | 18 | Storage Default 19 | { 20 | 21 | 22 | %%CLASSNAME 23 | 24 | 25 | Name 26 | 27 | 28 | DataUrl 29 | 30 | 31 | ^BG.AreaD 32 | AreaDefaultData 33 | ^BG.AreaD 34 | ^BG.AreaI 35 | ^BG.AreaS 36 | %Storage.Persistent 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/CZ/Area.cls: -------------------------------------------------------------------------------- 1 | Class CZ.Area Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | /// Name of the Region 5 | Property Name As %String(MAXLEN = 500) [ Required ]; 6 | 7 | /// Guid for polygons in js file 8 | Property Guid As %String [ Required ]; 9 | 10 | /// Link to Wiki article 11 | Property DataUrl As %String(MAXLEN = 500); 12 | 13 | /// All values 14 | Relationship Parameters As ParameterValue [ Cardinality = many, Inverse = Region ]; 15 | 16 | Index GuidIdx On Guid [ IdKey, Unique ]; 17 | 18 | Storage Default 19 | { 20 | 21 | 22 | %%CLASSNAME 23 | 24 | 25 | Name 26 | 27 | 28 | DataUrl 29 | 30 | 31 | ^CZ.AreaD 32 | AreaDefaultData 33 | ^CZ.AreaD 34 | ^CZ.AreaI 35 | ^CZ.AreaS 36 | %Storage.Persistent 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/KZ/Area.cls: -------------------------------------------------------------------------------- 1 | Class KZ.Area Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | /// Name of the Region 5 | Property Name As %String(MAXLEN = 500) [ Required ]; 6 | 7 | /// Guid for polygons in js file 8 | Property Guid As %String [ Required ]; 9 | 10 | /// Link to Wiki article 11 | Property DataUrl As %String(MAXLEN = 500); 12 | 13 | /// All values 14 | Relationship Parameters As ParameterValue [ Cardinality = many, Inverse = Region ]; 15 | 16 | Index GuidIdx On Guid [ IdKey, Unique ]; 17 | 18 | Storage Default 19 | { 20 | 21 | 22 | %%CLASSNAME 23 | 24 | 25 | Name 26 | 27 | 28 | DataUrl 29 | 30 | 31 | ^KZ.AreaD 32 | AreaDefaultData 33 | ^KZ.AreaD 34 | ^KZ.AreaI 35 | ^KZ.AreaS 36 | %Storage.Persistent 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/SE/Area.cls: -------------------------------------------------------------------------------- 1 | Class SE.Area Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | /// Name of the Region 5 | Property Name As %String(MAXLEN = 500) [ Required ]; 6 | 7 | /// Guid for polygons in js file 8 | Property Guid As %String [ Required ]; 9 | 10 | /// Link to Wiki article 11 | Property DataUrl As %String(MAXLEN = 500); 12 | 13 | /// All values 14 | Relationship Parameters As ParameterValue [ Cardinality = many, Inverse = Region ]; 15 | 16 | Index GuidIdx On Guid [ IdKey, Unique ]; 17 | 18 | Storage Default 19 | { 20 | 21 | 22 | %%CLASSNAME 23 | 24 | 25 | Name 26 | 27 | 28 | DataUrl 29 | 30 | 31 | ^SE.AreaD 32 | AreaDefaultData 33 | ^SE.AreaD 34 | ^SE.AreaI 35 | ^SE.AreaS 36 | %Storage.Persistent 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/UA/Area.cls: -------------------------------------------------------------------------------- 1 | Class UA.Area Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | /// Name of the Region 5 | Property Name As %String(MAXLEN = 500) [ Required ]; 6 | 7 | /// Guid for polygons in js file 8 | Property Guid As %String [ Required ]; 9 | 10 | /// Link to Wiki article 11 | Property DataUrl As %String(MAXLEN = 500); 12 | 13 | /// All values 14 | Relationship Parameters As ParameterValue [ Cardinality = many, Inverse = Region ]; 15 | 16 | Index GuidIdx On Guid [ IdKey, Unique ]; 17 | 18 | Storage Default 19 | { 20 | 21 | 22 | %%CLASSNAME 23 | 24 | 25 | Name 26 | 27 | 28 | DataUrl 29 | 30 | 31 | ^UA.AreaD 32 | AreaDefaultData 33 | ^UA.AreaD 34 | ^UA.AreaI 35 | ^UA.AreaS 36 | %Storage.Persistent 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/UK/Area.cls: -------------------------------------------------------------------------------- 1 | Class UK.Area Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | /// Name of the Region 5 | Property Name As %String(MAXLEN = 500) [ Required ]; 6 | 7 | /// Guid for polygons in js file 8 | Property Guid As %String [ Required ]; 9 | 10 | /// Link to Wiki article 11 | Property DataUrl As %String(MAXLEN = 500); 12 | 13 | /// All values 14 | Relationship Parameters As ParameterValue [ Cardinality = many, Inverse = Region ]; 15 | 16 | Index GuidIdx On Guid [ IdKey, Unique ]; 17 | 18 | Storage Default 19 | { 20 | 21 | 22 | %%CLASSNAME 23 | 24 | 25 | Name 26 | 27 | 28 | DataUrl 29 | 30 | 31 | ^UK.AreaD 32 | AreaDefaultData 33 | ^UK.AreaD 34 | ^UK.AreaI 35 | ^UK.AreaS 36 | %Storage.Persistent 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/FIN/Area.cls: -------------------------------------------------------------------------------- 1 | Class FIN.Area Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | /// Name of the Region 5 | Property Name As %String(MAXLEN = 500) [ Required ]; 6 | 7 | /// Guid for polygons in js file 8 | Property Guid As %String [ Required ]; 9 | 10 | /// Link to Wiki article 11 | Property DataUrl As %String(MAXLEN = 500); 12 | 13 | /// All values 14 | Relationship Parameters As ParameterValue [ Cardinality = many, Inverse = Region ]; 15 | 16 | Index GuidIdx On Guid [ IdKey, Unique ]; 17 | 18 | Storage Default 19 | { 20 | 21 | 22 | %%CLASSNAME 23 | 24 | 25 | Name 26 | 27 | 28 | DataUrl 29 | 30 | 31 | ^FIN.AreaD 32 | AreaDefaultData 33 | ^FIN.AreaD 34 | ^FIN.AreaI 35 | ^FIN.AreaS 36 | %Storage.Persistent 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/RSA/Area.cls: -------------------------------------------------------------------------------- 1 | Class RSA.Area Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | /// Name of the Region 5 | Property Name As %String(MAXLEN = 500) [ Required ]; 6 | 7 | /// Guid for polygons in js file 8 | Property Guid As %String [ Required ]; 9 | 10 | /// Link to Wiki article 11 | Property DataUrl As %String(MAXLEN = 500); 12 | 13 | /// All values 14 | Relationship Parameters As ParameterValue [ Cardinality = many, Inverse = Region ]; 15 | 16 | Index GuidIdx On Guid [ IdKey, Unique ]; 17 | 18 | Storage Default 19 | { 20 | 21 | 22 | %%CLASSNAME 23 | 24 | 25 | Name 26 | 27 | 28 | DataUrl 29 | 30 | 31 | ^RSA.AreaD 32 | AreaDefaultData 33 | ^RSA.AreaD 34 | ^RSA.AreaI 35 | ^RSA.AreaS 36 | %Storage.Persistent 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/USA/Parameter.cls: -------------------------------------------------------------------------------- 1 | Class USA.Parameter Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Property Name As %String [ Required ]; 5 | 6 | Property UnitName As %String; 7 | 8 | Relationship Values As ParameterValue [ Cardinality = many, Inverse = Parameter ]; 9 | 10 | ClassMethod GetIdByName(name As %String) As %String 11 | { 12 | set id=0 13 | &sql(SELECT ID INTO :id FROM USA.Parameter WHERE Name = :name) 14 | quit id 15 | } 16 | 17 | Storage Default 18 | { 19 | 20 | 21 | %%CLASSNAME 22 | 23 | 24 | Name 25 | 26 | 27 | UnitName 28 | 29 | 30 | ^USA.ParameterD 31 | ParameterDefaultData 32 | 100000 33 | ^USA.ParameterD 34 | ^USA.ParameterI 35 | ^USA.ParameterS 36 | %Storage.Persistent 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/USA/Area.cls: -------------------------------------------------------------------------------- 1 | /// Region, County, City 2 | Class USA.Area Extends (%Persistent, %XML.Adaptor) 3 | { 4 | 5 | /// Name of state|county|city 6 | Property Name As %String(MAXLEN = 500) [ Required ]; 7 | 8 | /// Guid for polygons in js file 9 | Property Guid As %String [ Required ]; 10 | 11 | /// Link to Wiki article 12 | Property DataUrl As %String(MAXLEN = 500); 13 | 14 | /// All values 15 | Relationship Parameters As ParameterValue [ Cardinality = many, Inverse = Area ]; 16 | 17 | Index GuidIdx On Guid [ IdKey, Unique ]; 18 | 19 | Storage Default 20 | { 21 | 22 | 23 | %%CLASSNAME 24 | 25 | 26 | Name 27 | 28 | 29 | DataUrl 30 | 31 | 32 | ^USA.AreaD 33 | AreaDefaultData 34 | 100000 35 | ^USA.AreaD 36 | ^USA.AreaI 37 | ^USA.AreaS 38 | %Storage.Persistent 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 InterSystems Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/RF/ParameterValue.cls: -------------------------------------------------------------------------------- 1 | /// Значение для определенного параметра, региона 2 | Class RF.ParameterValue Extends (%Persistent, %XML.Adaptor) 3 | { 4 | 5 | Property Region As RF.Region(XMLREFERENCE = "ID") [ Required ]; 6 | 7 | Property Parameter As RF.Parameter(XMLREFERENCE = "ID") [ Required ]; 8 | 9 | Index RegionParameterIndex On (Region, Parameter) [ Unique ]; 10 | 11 | Property Value As %Float; 12 | 13 | Storage Default 14 | { 15 | 16 | 17 | %%CLASSNAME 18 | 19 | 20 | Region 21 | 22 | 23 | Parameter 24 | 25 | 26 | Value 27 | 28 | 29 | RegionName 30 | 31 | 32 | ^RF.ParameterValueD 33 | ParameterValueDefaultData 34 | 100000 35 | ^RF.ParameterValueD 36 | ^RF.ParameterValueI 37 | ^RF.ParameterValueS 38 | %Storage.Persistent 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /iris.script: -------------------------------------------------------------------------------- 1 | // Unexpire passwords to simplify dev mode. Comment these two lines for Production use 2 | zn "%SYS" 3 | Do ##class(Security.Users).UnExpireUserPasswords("*") 4 | 5 | ; enabling callin for Embedded Python 6 | do ##class(Security.Services).Get("%Service_CallIn",.prop) 7 | set prop("Enabled")=1 8 | set prop("AutheEnabled")=48 9 | do ##class(Security.Services).Modify("%Service_CallIn",.prop) 10 | 11 | // install IPM 12 | s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c") 13 | 14 | 15 | // load all the code of the project as a ZPM package 16 | zn "USER" 17 | zpm "install isc-dev" 18 | ;zpm "install dsw" 19 | 20 | do ##class(dev.code).workdir("/home/irisowner/irisdev/src") 21 | 22 | zpm "install git-source-control" 23 | do ##class(%Studio.SourceControl.Interface).SourceControlClassSet("SourceControl.Git.Extension") 24 | 25 | 26 | zpm "load /home/irisowner/irisdev/ -v":1 27 | zn "%SYS" 28 | zpm "install passwordless" 29 | 30 | 31 | 32 | halt 33 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG IMAGE=intersystemsdc/irishealth-community:2020.3.0.200.0-zpm 2 | ARG IMAGE=intersystemsdc/iris-community:2020.4.0.547.0-zpm 3 | ARG IMAGE=containers.intersystems.com/intersystems/iris:2021.1.0.215.0 4 | ARG IMAGE=intersystemsdc/iris-community:2024.1-zpm 5 | ARG IMAGE=containers.intersystems.com/intersystems/iris-community:latest-preview 6 | ARG IMAGE=intersystemsdc/iris-community 7 | FROM $IMAGE 8 | 9 | WORKDIR /home/irisowner/irisdev/ 10 | 11 | ## install git 12 | ## USER root 13 | ##RUN apt update && apt-get -y install git 14 | ##USER ${ISC_PACKAGE_MGRUSER} 15 | 16 | ARG TESTS=0 17 | ARG MODULE="dsw-map" 18 | ARG NAMESPACE="USER" 19 | 20 | ## Embedded Python environment 21 | ENV IRISUSERNAME "_SYSTEM" 22 | ENV IRISPASSWORD "SYS" 23 | ENV IRISNAMESPACE $NAMESPACE 24 | ENV PYTHON_PATH=/usr/irissys/bin/ 25 | ENV PATH "/usr/irissys/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/irisowner/bin" 26 | 27 | 28 | RUN --mount=type=bind,src=.,dst=. \ 29 | #pip3 install -r requirements.txt && \ 30 | iris start IRIS && \ 31 | iris session IRIS < iris.script && \ 32 | ([ $TESTS -eq 0 ] || iris session iris -U $NAMESPACE "##class(%ZPM.PackageManager).Shell(\"test $MODULE -v -only\",1,1)") && \ 33 | iris stop IRIS quietly 34 | -------------------------------------------------------------------------------- /src/ID/ParameterValue.cls: -------------------------------------------------------------------------------- 1 | Class ID.ParameterValue Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Relationship Region As Area(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Parameters ]; 5 | 6 | /// State, county or city 7 | /// Parameter 8 | Relationship Parameter As Parameter(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Values ]; 9 | 10 | /// Value for region|county|city 11 | Property Value As %Float [ Required ]; 12 | 13 | Index PVIdx On (Region, Parameter); 14 | 15 | Index RegionParameterIndex On (Region, Parameter) [ Unique ]; 16 | 17 | Storage Default 18 | { 19 | 20 | 21 | %%CLASSNAME 22 | 23 | 24 | Region 25 | 26 | 27 | Parameter 28 | 29 | 30 | Value 31 | 32 | 33 | ^ID.ParameterValueD 34 | ParameterValueDefaultData 35 | ^ID.ParameterValueD 36 | ^ID.ParameterValueI 37 | ^ID.ParameterValueS 38 | %Storage.Persistent 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/BG/ParameterValue.cls: -------------------------------------------------------------------------------- 1 | Class BG.ParameterValue Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Relationship Region As Area(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Parameters ]; 5 | 6 | /// State, county or city 7 | /// Parameter 8 | Relationship Parameter As Parameter(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Values ]; 9 | 10 | /// Value for region|county|city 11 | Property Value As %Float [ Required ]; 12 | 13 | Index PVIdx On (Region, Parameter); 14 | 15 | Index RegionParameterIndex On (Region, Parameter) [ Unique ]; 16 | 17 | Storage Default 18 | { 19 | 20 | 21 | %%CLASSNAME 22 | 23 | 24 | Region 25 | 26 | 27 | Parameter 28 | 29 | 30 | Value 31 | 32 | 33 | ^BG.ParameterValueD 34 | ParameterValueDefaultData 35 | ^BG.ParameterValueD 36 | ^BG.ParameterValueI 37 | ^BG.ParameterValueS 38 | %Storage.Persistent 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/CZ/ParameterValue.cls: -------------------------------------------------------------------------------- 1 | Class CZ.ParameterValue Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Relationship Region As Area(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Parameters ]; 5 | 6 | /// State, county or city 7 | /// Parameter 8 | Relationship Parameter As Parameter(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Values ]; 9 | 10 | /// Value for region|county|city 11 | Property Value As %Float [ Required ]; 12 | 13 | Index PVIdx On (Region, Parameter); 14 | 15 | Index RegionParameterIndex On (Region, Parameter) [ Unique ]; 16 | 17 | Storage Default 18 | { 19 | 20 | 21 | %%CLASSNAME 22 | 23 | 24 | Region 25 | 26 | 27 | Parameter 28 | 29 | 30 | Value 31 | 32 | 33 | ^CZ.ParameterValueD 34 | ParameterValueDefaultData 35 | ^CZ.ParameterValueD 36 | ^CZ.ParameterValueI 37 | ^CZ.ParameterValueS 38 | %Storage.Persistent 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/KZ/ParameterValue.cls: -------------------------------------------------------------------------------- 1 | Class KZ.ParameterValue Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Relationship Region As Area(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Parameters ]; 5 | 6 | /// State, county or city 7 | /// Parameter 8 | Relationship Parameter As Parameter(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Values ]; 9 | 10 | /// Value for region|county|city 11 | Property Value As %Float [ Required ]; 12 | 13 | Index PVIdx On (Region, Parameter); 14 | 15 | Index RegionParameterIndex On (Region, Parameter) [ Unique ]; 16 | 17 | Storage Default 18 | { 19 | 20 | 21 | %%CLASSNAME 22 | 23 | 24 | Region 25 | 26 | 27 | Parameter 28 | 29 | 30 | Value 31 | 32 | 33 | ^KZ.ParameterValueD 34 | ParameterValueDefaultData 35 | ^KZ.ParameterValueD 36 | ^KZ.ParameterValueI 37 | ^KZ.ParameterValueS 38 | %Storage.Persistent 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/SE/ParameterValue.cls: -------------------------------------------------------------------------------- 1 | Class SE.ParameterValue Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Relationship Region As Area(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Parameters ]; 5 | 6 | /// State, county or city 7 | /// Parameter 8 | Relationship Parameter As Parameter(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Values ]; 9 | 10 | /// Value for region|county|city 11 | Property Value As %Float [ Required ]; 12 | 13 | Index PVIdx On (Region, Parameter); 14 | 15 | Index RegionParameterIndex On (Region, Parameter) [ Unique ]; 16 | 17 | Storage Default 18 | { 19 | 20 | 21 | %%CLASSNAME 22 | 23 | 24 | Region 25 | 26 | 27 | Parameter 28 | 29 | 30 | Value 31 | 32 | 33 | ^SE.ParameterValueD 34 | ParameterValueDefaultData 35 | ^SE.ParameterValueD 36 | ^SE.ParameterValueI 37 | ^SE.ParameterValueS 38 | %Storage.Persistent 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/UA/ParameterValue.cls: -------------------------------------------------------------------------------- 1 | Class UA.ParameterValue Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Relationship Region As Area(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Parameters ]; 5 | 6 | /// State, county or city 7 | /// Parameter 8 | Relationship Parameter As Parameter(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Values ]; 9 | 10 | /// Value for region|county|city 11 | Property Value As %Float [ Required ]; 12 | 13 | Index PVIdx On (Region, Parameter); 14 | 15 | Index RegionParameterIndex On (Region, Parameter) [ Unique ]; 16 | 17 | Storage Default 18 | { 19 | 20 | 21 | %%CLASSNAME 22 | 23 | 24 | Region 25 | 26 | 27 | Parameter 28 | 29 | 30 | Value 31 | 32 | 33 | ^UA.ParameterValueD 34 | ParameterValueDefaultData 35 | ^UA.ParameterValueD 36 | ^UA.ParameterValueI 37 | ^UA.ParameterValueS 38 | %Storage.Persistent 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/UK/ParameterValue.cls: -------------------------------------------------------------------------------- 1 | Class UK.ParameterValue Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Relationship Region As Area(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Parameters ]; 5 | 6 | /// State, county or city 7 | /// Parameter 8 | Relationship Parameter As Parameter(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Values ]; 9 | 10 | /// Value for region|county|city 11 | Property Value As %Float [ Required ]; 12 | 13 | Index PVIdx On (Region, Parameter); 14 | 15 | Index RegionParameterIndex On (Region, Parameter) [ Unique ]; 16 | 17 | Storage Default 18 | { 19 | 20 | 21 | %%CLASSNAME 22 | 23 | 24 | Region 25 | 26 | 27 | Parameter 28 | 29 | 30 | Value 31 | 32 | 33 | ^UK.ParameterValueD 34 | ParameterValueDefaultData 35 | ^UK.ParameterValueD 36 | ^UK.ParameterValueI 37 | ^UK.ParameterValueS 38 | %Storage.Persistent 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/RSA/ParameterValue.cls: -------------------------------------------------------------------------------- 1 | Class RSA.ParameterValue Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Relationship Region As Area(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Parameters ]; 5 | 6 | /// State, county or city 7 | /// Parameter 8 | Relationship Parameter As Parameter(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Values ]; 9 | 10 | /// Value for region|county|city 11 | Property Value As %Float [ Required ]; 12 | 13 | Index PVIdx On (Region, Parameter); 14 | 15 | Index RegionParameterIndex On (Region, Parameter) [ Unique ]; 16 | 17 | Storage Default 18 | { 19 | 20 | 21 | %%CLASSNAME 22 | 23 | 24 | Region 25 | 26 | 27 | Parameter 28 | 29 | 30 | Value 31 | 32 | 33 | ^RSA.ParameterValueD 34 | ParameterValueDefaultData 35 | ^RSA.ParameterValueD 36 | ^RSA.ParameterValueI 37 | ^RSA.ParameterValueS 38 | %Storage.Persistent 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/RF/PERM/ParameterValue.cls: -------------------------------------------------------------------------------- 1 | Class RF.PERM.ParameterValue Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Relationship Region As Region(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Parameters ]; 5 | 6 | /// State, county or city 7 | /// Parameter 8 | Relationship Parameter As Parameter(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Values ]; 9 | 10 | /// Value for region|county|city 11 | Property Value As %Float [ Required ]; 12 | 13 | Index PVIdx On (Region, Parameter); 14 | 15 | Index RegionParameterIndex On (Region, Parameter) [ Unique ]; 16 | 17 | Storage Default 18 | { 19 | 20 | 21 | %%CLASSNAME 22 | 23 | 24 | Region 25 | 26 | 27 | Parameter 28 | 29 | 30 | Value 31 | 32 | 33 | ^RF.PERM.ParameterValueD 34 | ParameterValueDefaultData 35 | ^RF.PERM.ParameterValueD 36 | ^RF.PERM.ParameterValueI 37 | ^RF.PERM.ParameterValueS 38 | %Storage.Persistent 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/USA/ParameterValue.cls: -------------------------------------------------------------------------------- 1 | Class USA.ParameterValue Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | /// State, county or city 5 | Relationship Area As Area(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Parameters ]; 6 | 7 | /// Parameter 8 | Relationship Parameter As Parameter(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Values ]; 9 | 10 | /// Value for region|county|city 11 | Property Value As %Float [ Required ]; 12 | 13 | Index PVIdx On (Area, Parameter); 14 | 15 | Index RegionParameterIndex On (Area, Parameter) [ Unique ]; 16 | 17 | Storage Default 18 | { 19 | 20 | 21 | %%CLASSNAME 22 | 23 | 24 | Area 25 | 26 | 27 | Parameter 28 | 29 | 30 | Value 31 | 32 | 33 | ^USA.ParameterValueD 34 | ParameterValueDefaultData 35 | 100000 36 | ^USA.ParameterValueD 37 | ^USA.ParameterValueI 38 | ^USA.ParameterValueS 39 | %Storage.Persistent 40 | } 41 | 42 | } 43 | 44 | -------------------------------------------------------------------------------- /src/USA/Region.cls: -------------------------------------------------------------------------------- 1 | /// State or county 2 | Class USA.Region Extends Area 3 | { 4 | 5 | /// Capital for state. seat - for county 6 | Property Capital As City(XMLREFERENCE = "ID"); 7 | 8 | /// DefaultZoom 9 | Property DefaultZoom As %Integer; 10 | 11 | /// Level in the hierarchy 12 | Property HLevel As %Integer [ Required ]; 13 | 14 | /// Parent of region. For state=null, for county=state 15 | Relationship ParentRegion As Region(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = ChildrenRegions ]; 16 | 17 | /// Region childrens. For state=counties, for county=0 18 | Relationship ChildrenRegions As Region [ Cardinality = many, Inverse = ParentRegion ]; 19 | 20 | /// Cities in county 21 | Relationship Cities As City [ Cardinality = many, Inverse = Region ]; 22 | 23 | Index ParentRegionIdx On ParentRegion; 24 | 25 | Storage Default 26 | { 27 | 28 | "Region" 29 | 30 | Capital 31 | 32 | 33 | DefaultZoom 34 | 35 | 36 | HLevel 37 | 38 | 39 | ParentRegion 40 | 41 | 42 | RegionDefaultData 43 | %Storage.Persistent 44 | } 45 | 46 | } 47 | 48 | -------------------------------------------------------------------------------- /src/FIN/ParameterValue.cls: -------------------------------------------------------------------------------- 1 | Class FIN.ParameterValue Extends (%Persistent, %XML.Adaptor) 2 | { 3 | 4 | Relationship Region As Area(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Parameters ]; 5 | 6 | /// State, county or city 7 | /// Parameter 8 | Relationship Parameter As Parameter(XMLPROJECTION = "XELEMENT", XMLREFERENCE = "ID") [ Cardinality = one, Inverse = Values ]; 9 | 10 | /// Value for region|county|city 11 | Property Value As %Float [ Required ]; 12 | 13 | Index PVIdx On (Region, Parameter); 14 | 15 | Index RegionParameterIndex On (Region, Parameter) [ Unique ]; 16 | 17 | Storage Default 18 | { 19 | 20 | 21 | %%CLASSNAME 22 | 23 | 24 | Value 25 | 26 | 27 | Parameter 28 | 29 | 30 | Region 31 | 32 | 33 | Area 34 | 35 | 36 | ^FIN.ParameterValueD 37 | ParameterValueDefaultData 38 | ^FIN.ParameterValueD 39 | ^FIN.ParameterValueI 40 | ^FIN.ParameterValueS 41 | %Storage.Persistent 42 | } 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /src/RF/SAKH/Region.cls: -------------------------------------------------------------------------------- 1 | /// State or county 2 | Class RF.SAKH.Region Extends %Persistent 3 | { 4 | 5 | Property Name As %String(MAXLEN = 500) [ Required ]; 6 | 7 | /// population property 8 | Property Population As %Integer; 9 | 10 | ClassMethod Populate() 11 | { 12 | for i="Невельский район","Южно-Сахалинск","Поронайский район","Александровск-Сахалинский район","Охинский район","Углегорский район","Холмский район","Корсаковский район","Томаринский район","Южно-Курильский район","Смирныховский район","Анивский район","Ногликский район","Долинский район","Тымовский район","Макаровский район","Северо-Курильский район","Курильский район" 13 | { 14 | set obj=##class(RF.SAKH.Region).%New() 15 | set obj.Name=i 16 | set obj.Population=$R(100000) 17 | d obj.%Save() 18 | w obj.Name," created",! 19 | } 20 | } 21 | 22 | Storage Default 23 | { 24 | 25 | 26 | %%CLASSNAME 27 | 28 | 29 | Name 30 | 31 | 32 | Population 33 | 34 | 35 | ^RF.SAKH.RegionD 36 | RegionDefaultData 37 | ^RF.SAKH.RegionD 38 | ^RF.SAKH.RegionI 39 | ^RF.SAKH.RegionS 40 | %Storage.Persistent 41 | } 42 | 43 | } 44 | 45 | -------------------------------------------------------------------------------- /src/RF/SAKH/SAKHCube.cls: -------------------------------------------------------------------------------- 1 | /// 2 | Class RF.SAKH.SAKHCube Extends %DeepSee.CubeDefinition [ DependsOn = RF.SAKH.Region, ProcedureBlock ] 3 | { 4 | 5 | /// Cube definition from Architect. 6 | XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ] 7 | { 8 | 9 | 19 | 20 | } 21 | 22 | Parameter DOMAIN; 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/RF/KHAB/BI/KHABCube.cls: -------------------------------------------------------------------------------- 1 | /// 2 | Class RF.KHAB.BI.KHABCube Extends %DeepSee.CubeDefinition [ DependsOn = RF.KHAB.Region, ProcedureBlock ] 3 | { 4 | 5 | /// Cube definition from Architect. 6 | XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ] 7 | { 8 | 9 | 19 | 20 | } 21 | 22 | Parameter DOMAIN; 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/World/Countries.cls: -------------------------------------------------------------------------------- 1 | /// State or county 2 | Class World.Countries Extends %Persistent 3 | { 4 | 5 | Property Name As %String(MAXLEN = 500) [ Required ]; 6 | 7 | /// population property 8 | Property Population As %Integer; 9 | 10 | ClassMethod Populate() 11 | { 12 | //for i="Невельский район","Южно-Сахалинск","Поронайский район","Александровск-Сахалинский район","Охинский район","Углегорский район","Холмский район","Корсаковский район","Томаринский район","Южно-Курильский район","Смирныховский район","Анивский район","Ногликский район","Долинский район","Тымовский район","Макаровский район","Северо-Курильский район","Курильский район" 13 | for i="Russia","Germany","United States of America" 14 | { 15 | set obj=..%New() 16 | set obj.Name=i 17 | set obj.Population=$R(100000) 18 | d obj.%Save() 19 | w obj.Name," created",! 20 | } 21 | } 22 | 23 | Storage Default 24 | { 25 | 26 | 27 | %%CLASSNAME 28 | 29 | 30 | Name 31 | 32 | 33 | Population 34 | 35 | 36 | ^World.CountriesD 37 | CountriesDefaultData 38 | ^World.CountriesD 39 | ^World.CountriesI 40 | ^World.CountriesS 41 | %Storage.Persistent 42 | } 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dsw-map 2 | 3 | [![Gitter](https://img.shields.io/badge/chat-on%20telegram-blue.svg)](https://t.me/joinchat/FoZ4M0rd1_WFij2rqvUR2A) 4 | [![Gitter](https://img.shields.io/badge/demo-server-green.svg)](http://37.139.6.217:52774/dsw/index.html#!/?ns=dswmap) 5 | 6 | map examples of different regions to render in DeepSeeWeb 7 | 8 | [Online demo](https://dswmap.demo.community.intersystems.com/dsw/index.html#/login?from=%2FUSER) 9 | 10 | Non issue 11 | ----------- 12 | If you are using the local host as the server, then replace **localhost** with IP **127.0.0.1** to avoid an error. 13 | 14 | Installation 15 | ----------- 16 | 17 | ZPM 18 | ----------- 19 | 20 | USER>zpm "install dsw-map" 21 | 22 | 23 | 24 | 0. Be sure you have [MDX2JSON](https://github.com/intersystems-ru/Cache-MDX2JSON) and [DeepSeeWeb](https://github.com/intersystems-ru/DeepSeeWeb) installed. 25 | 26 | 1. Download [release.xml](https://github.com/intersystems-ru/dsw-map/releases/) file and import it into a target Namespace. 27 | 2. To setup all the maps run in the terminal: 28 | ``` 29 | d ##class(DSWMap.Utils).SetupAll() 30 | ``` 31 | Or run following to setup special map only: 32 | ``` 33 | d ##class([MapName].Utils).Setup() 34 | ``` 35 | 3. Download [polygons.zip](https://github.com/intersystems-ru/dsw-map/releases/) and place polygons files in /csp/yourtargetnamespace. 36 | 4. Download [TermList.xml] and impot global from it into target Namespace 37 | 5. Open yourserver/dsw/ in a target namespace and get the maps. 38 | -------------------------------------------------------------------------------- /src/RF/KHAB/Utils.cls: -------------------------------------------------------------------------------- 1 | Class RF.KHAB.Utils 2 | { 3 | 4 | ClassMethod Setup() As %Status 5 | { 6 | set sc = ..Populate() 7 | do ##class(%DeepSee.Utils).%BuildCube("KHABCube",0) 8 | quit sc 9 | } 10 | 11 | ClassMethod Populate() As %Status 12 | { 13 | set (sc1, sc2) = $$$OK 14 | 15 | set sc1 = ##class(RF.KHAB.Region).%KillExtent() 16 | 17 | set ^regions("Аяно-Майский район") = 1971 18 | set ^regions("Охотский район") = 6717 19 | set ^regions("Тугуро-Чумиканский район") = 1972 20 | set ^regions("Имени Полины Осипенко район") = 4627 21 | set ^regions("Вяземский район") = 21238 22 | set ^regions("Бикинский район") = 22641 23 | set ^regions("Хабаровский район") = 90180 24 | set ^regions("Николаевский район") = 28331 25 | set ^regions("Ульчский район") = 16044 26 | set ^regions("Верхнебуреинский район") = 25351 27 | set ^regions("Амурский район") = 61291 28 | set ^regions("Комсомольск-на-Амуре") = 251283 29 | set ^regions("Солнечный район") = 30809 30 | set ^regions("Ванинский район") = 34316 31 | set ^regions("Имени Лазо район") = 42238 32 | set ^regions("Комсомольский район") = 28000 33 | set ^regions("Нанайский район") = 16332 34 | set ^regions("Советско-Гаванский район") = 40051 35 | set ^regions("Хабаровск") = 611160 36 | 37 | set key = $order(^regions("")) 38 | while (key '= "") { 39 | set obj = ##class(Region).%New() 40 | set obj.Key = key 41 | set obj.Name = key 42 | set obj.Population = ^regions(key) 43 | set sc2 = obj.%Save() 44 | 45 | set key = $order(^regions(key)) 46 | } 47 | 48 | quit $$$ADDSC(sc1, sc2) 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /module.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | dsw-map 6 | 1.0.19 7 | Provides sample data for use with InterSystems IRIS Business Intelligence, as well as fully developed sample BI models and dashboards. 8 | module 9 | src 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | dsw 29 | 4.*.* 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/UA21/BI/UA21Cube.cls: -------------------------------------------------------------------------------- 1 | Class UA21.BI.UA21Cube Extends %DeepSee.CubeDefinition [ DependsOn = UA21.District, ProcedureBlock ] 2 | { 3 | 4 | /// Cube definition from Architect. 5 | XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ] 6 | { 7 | 8 | 20 | 22 | 23 | } 24 | 25 | Parameter DOMAIN; 26 | 27 | } -------------------------------------------------------------------------------- /src/gbl/DeepSee.TermList.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ^DeepSee.TermList 5 | BG SOURCES 6 | data 7 | Area 8 | VALUE 9 | BG/Area Map.pivot 10 | 11 | 12 | Population 13 | VALUE 14 | BG/Population Map.pivot 15 | 16 | 17 | 18 | modDate 19 | 2019-08-03 13:02:33 20 | 21 | name 22 | BG Sources 23 | 24 | 25 | ELECTION VOTES 26 | data 27 | Votes Temperature 28 | VALUE 29 | USA/Elections.pivot 30 | 31 | 32 | Winner Takes All 33 | VALUE 34 | USA/Elections2.pivot 35 | 36 | 37 | 38 | modDate 39 | 2016-11-30 15:56:38 40 | 41 | name 42 | Election Votes 43 | 44 | 45 | USMAPSOURCES 46 | caption 47 | Map Sources 48 | 49 | data 50 | Area 51 | VALUE 52 | USA/USMapArea.pivot 53 | 54 | 55 | Density 56 | VALUE 57 | USA/USMapDensity.pivot 58 | 59 | 60 | Population 61 | VALUE 62 | USA/US Map Population.pivot 63 | 64 | 65 | 66 | modDate 67 | 2016-03-11 01:36:04 68 | 69 | name 70 | USMapSources 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /src/js/idpolygons.js: -------------------------------------------------------------------------------- 1 | function loadCoordinates(polygonCoordsArray) { 2 | 3 | // north sulawesi 4 | polygonCoordsArray['1'] = 5 | '123.095,0.92 123.095,1.25 123.11,1.27 124.215,1.365 124.535,1.865 124.945,2.795 125.1,4.26 125.23,4.77 125.32,4.895 126.455,5.745 126.525,5.78 126.61,5.785 126.705,5.755 126.77,5.695 127.325,4.895 127.36,4.81 127.385,4.6 127.12,3.845 127.815,3.465 127.825,3.455 127.825,3.435 127.1,2.89 126.265,2.03 125.93,1.73 125.545,0.93 125.54,0.24 124.885,-0.565 124.865,-0.575 123.375,-0.085 123.365,-0.075 123.365,-0.06 123.46,0.32 123.46,0.355 123.495,0.41 123.515,0.425 123.5,0.49 123.505,0.505 123.53,0.515 123.52,0.515 123.505,0.535 123.515,0.565 123.495,0.57 123.47,0.59 123.47,0.61 123.44,0.62 123.365,0.625 123.34,0.64 123.325,0.67 123.295,0.68 123.275,0.675 123.235,0.7 123.23,0.76 123.25,0.78 123.25,0.79 123.235,0.795 123.23,0.815 123.215,0.82 123.21,0.83 123.145,0.85 123.11,0.87 123.095,0.895 123.095,0.92'; 6 | // gorontalo 7 | polygonCoordsArray['1.1'] = 8 | '121.145,0.665 121.135,0.685 121.16,0.71 121.165,0.725 121.16,0.75 121.175,0.775 121.195,0.78 121.195,0.8 121.23,0.82 121.32,0.81 121.33,0.815 121.325,0.855 121.345,0.87 121.46,0.865 121.49,0.855 121.51,0.865 121.52,0.89 121.53,0.895 121.555,0.9 121.6,0.89 121.62,0.905 121.675,0.925 121.695,0.925 121.735,0.95 121.77,0.955 121.805,0.975 121.815,0.99 121.85,1 121.89,0.99 121.96,0.93 121.975,0.95 122.005,0.965 122.02,0.99 122.055,1.01 122.095,1.01 122.105,1.025 122.13,1.025 122.15,1.04 122.17,1.04 122.18,1.05 122.275,1.37 122.285,1.385 122.3,1.385 122.465,1.355 123.125,1.27 123.135,1.26 123.14,0.905 123.205,0.875 123.22,0.875 123.26,0.845 123.265,0.83 123.29,0.81 123.295,0.78 123.27,0.74 123.275,0.725 123.34,0.71 123.39,0.66 123.47,0.655 123.51,0.635 123.51,0.61 123.55,0.59 123.555,0.575 123.55,0.545 123.57,0.53 123.565,0.49 123.54,0.475 123.565,0.45 123.57,0.43 123.54,0.39 123.525,0.385 123.5,0.33 123.405,-0.08 123.395,-0.085 122.375,0.075 121.35,0.11 121.315,0.46 121.325,0.49 121.31,0.505 121.31,0.53 121.315,0.54 121.325,0.54 121.325,0.55 121.305,0.545 121.28,0.565 121.265,0.565 121.225,0.59 121.21,0.62 121.185,0.625 121.145,0.665'; 9 | } -------------------------------------------------------------------------------- /src/dfi/Russia/Map.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/ID/Utils.cls: -------------------------------------------------------------------------------- 1 | Class ID.Utils 2 | { 3 | 4 | ClassMethod Setup() 5 | { 6 | do ..Populate() 7 | do ##class(%DeepSee.Utils).%BuildCube("IDCube",0) 8 | } 9 | 10 | ClassMethod Populate() As %Status 11 | { 12 | do $CLASSMETHOD("ID.Area", "%KillExtent") 13 | do ..ImportXData("ID.Region", "RegionXData") 14 | do ..ImportXData("ID.Parameter", "ParameterXData") 15 | do ..ImportXData("ID.ParameterValue", "ParameterValueXData") 16 | quit $$$OK 17 | } 18 | 19 | ClassMethod ImportXData(className As %String, xDataName As %String) As %Status 20 | { 21 | #dim sc As %Status = $$$OK 22 | set sc= $CLASSMETHOD(className, "%KillExtent") 23 | 24 | set itemsCount = 0 25 | 26 | try{ 27 | 28 | if $$$ISERR(sc) 29 | { 30 | write !, $System.Status.DisplayError(sc) 31 | $$$THROWONERROR(sc,sc) 32 | } 33 | 34 | #dim stream As %Stream.Object = ##class(%Dictionary.CompiledXData).%OpenId("ID.Utils"_"||"_xDataName).Data 35 | #dim reader As %XML.Reader = ##class(%XML.Reader).%New() 36 | 37 | set sc = reader.OpenStream(stream, "literal") 38 | $$$THROWONERROR(sc,sc) 39 | 40 | do reader.Correlate($piece(className, ".", 2), className) 41 | 42 | while reader.Next(.obj, .sc) 43 | { 44 | if $$$ISERR(sc) 45 | { 46 | write !, $System.Status.DisplayError(sc) 47 | $$$THROWONERROR(sc,sc) 48 | } 49 | 50 | set sc = obj.%Save() 51 | 52 | if $$$ISERR(sc) 53 | { 54 | write !, $System.Status.DisplayError(sc) 55 | $$$THROWONERROR(sc,sc) 56 | } 57 | 58 | set obj = "" 59 | set itemsCount = itemsCount + 1 60 | } 61 | } 62 | catch(ex){ 63 | w !, ex.Name_" "_ex.Location 64 | } 65 | 66 | write !,"Import - "_itemsCount_" objects of class "_className 67 | 68 | Quit $$$OK 69 | } 70 | 71 | XData RegionXData 72 | { 73 | 74 | 75 | North Sulawesi 76 | 1 77 | North Sulawesi 78 | 79 | 80 | Gorontalo 81 | 1.1 82 | Gorontalo 83 | 1 84 | 85 | 86 | } 87 | 88 | XData ParameterValueXData 89 | { 90 | 91 | 92 | 1 93 | 1 94 | 2621923 95 | 96 | 97 | 1.1 98 | 1 99 | 1171681 100 | 101 | 102 | } 103 | 104 | XData ParameterXData 105 | { 106 | 107 | 108 | Population 109 | 110 | 111 | Area 112 | sq km 113 | 114 | 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /src/RF/PERM/BI/PERMCube.cls: -------------------------------------------------------------------------------- 1 | /// 2 | Class RF.PERM.BI.PERMCube Extends %DeepSee.CubeDefinition [ DependsOn = RF.PERM.Region, ProcedureBlock ] 3 | { 4 | 5 | /// Cube definition from Architect. 6 | XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ] 7 | { 8 | 9 | 23 | 24 | 25 | 26 | } 27 | 28 | ClassMethod GetColor(min, max, value) As %String 29 | { 30 | if ('value) return "rgb(0,0,0)" 31 | 32 | // Крайние границы: красный и зеленый, цвет для середины - желтый 33 | set middle = (max + min) / 2 34 | 35 | if (value <= middle) 36 | { 37 | set redPart = (value - min) / (middle - min) 38 | return "rgb(" _ (255 * redPart\1) _ ",255, 0)" 39 | } 40 | else 41 | { 42 | set greenPart = (max - value) / (max - middle) 43 | return "rgb(255," _(255 * greenPart\1) _ ", 0)" 44 | } 45 | } 46 | 47 | ClassMethod GetValue(guid, type) As %Integer 48 | { 49 | 50 | //b "L" 51 | //type=1 - population 52 | //type=2 - area 53 | // density 54 | s region=##class(RF.PERM.Region).%OpenId(guid) 55 | if $IsObject(region) { 56 | s parameter=##class(RF.PERM.ParameterValue).RegionParameterIndexOpen(region.Guid,type) 57 | if $IsObject(parameter) return parameter.Value} 58 | return "" 59 | } 60 | 61 | Parameter DOMAIN; 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /dev.md: -------------------------------------------------------------------------------- 1 | # Developer Notes 2 | 3 | This file complements the [main README](README.md) with additional background on how this sample can be set up and what automation was added. 4 | 5 | ## Files used in this repository 6 | 7 | Sample code 8 | * `src/cls/`: This folder contains the main ObjectScript code for this sample and its contents is described in the [main README](README.md) 9 | * `src/gbl/ZipCodeData.xml` contains a global export with static data used in the sample 10 | 11 | Setup options 12 | * Manual setup: 13 | * `buildsample/Build.SampleBI.xml` has the ObjectScript code to manually configure and populate the sample, as explained in the [main README](README.md) 14 | * ZPM setup: 15 | * `module.xml` is the main descriptor file for setting up the sample through [ZPM](https://github.com/intersystems-community/zpm), as an alternative to the manual setup procedure 16 | * Docker setup: 17 | * `Dockerfile` has the build recipe for building an entire Docker image out of this sample repository 18 | * `iris.script` has ObjectScript code to set up the sample namespace and then invokes ZPM for setting up the actual sample as described above. 19 | * `Installer.cls` is an [installation manifest](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GCI_MANIFEST) called by `iris.script` to set up the sample namespace 20 | * `.dockerignore` is a standard Docker configuration file to leave some repository contents out of the Docker build scope 21 | * `docker-compose.xml` adds convenience by scripting how to launch a container based on that image. 22 | 23 | Miscellaneous 24 | * `.vscode` is a configuration file for [Visual Studio Code](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=PAGE_vscode), the recommended editor for ObjectScript code on InterSystems IRIS 25 | * `.gitattributes` and `.gitignore` are configuration files for Git source control and otherwise don't impact the sample 26 | * `.github/workflows/` has a few scripts for automated CI/CD workflows, leveraging [GitHub Actions](https://github.com/features/actions) 27 | 28 | ## Useful commands 29 | 30 | ### Build container with no cache 31 | ``` 32 | docker compose build --no-cache --progress=plain 33 | ``` 34 | 35 | ### Open terminal to docker in a NAMESPACE 36 | ``` 37 | docker compose exec iris iris session iris -U USER 38 | ``` 39 | 40 | ### Clear docker fs 41 | ``` 42 | docker system prune -f 43 | 44 | docker system prune -a 45 | docker rm -f $(docker ps -qa) 46 | ``` 47 | 48 | ### Open SQL shell 49 | ```ObjectScript 50 | d $System.SQL.Shell() 51 | ``` 52 | 53 | ## export IRIS Analytics artifacts 54 | ``` 55 | d ##class(dev.code).export("*.DFI") 56 | ``` 57 | ## build cube 58 | ``` 59 | do ##class(%DeepSee.Utils).%BuildCube("CubeName") 60 | ``` 61 | ## export globals 62 | ``` 63 | do $System.OBJ.Export("dc*.GBL","/irisdev/app/src/gbl/globals.xml",,.errors) 64 | zw errors 65 | ``` 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/dfi/UA21/UA21-population.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/dfi/BG/Map of Bulgaria.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | 9 | 10 | 11 | 42.75 12 | 25.34 13 | 7 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/dfi/FIN/FinMap.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/RF/Region.cls: -------------------------------------------------------------------------------- 1 | /// Федаральные округа, субъекты, районы и населенные пункты 2 | Class RF.Region Extends (%Persistent, %XML.Adaptor) 3 | { 4 | 5 | /// Название админ. единицы 6 | Property Name As %String(MAXLEN = 750) [ Required ]; 7 | 8 | /// Идектификатор GUID. вместо ID 9 | Property Guid As %String [ Required ]; 10 | 11 | /// Идектификатор GUID Родителя 12 | Property ParentGuid As Region(XMLREFERENCE = "ID"); 13 | 14 | /// Широта 15 | Property Latitude As %String; 16 | 17 | /// Долгота 18 | Property Longitude As %String; 19 | 20 | /// Масштаб по умолчанию 21 | Property DefaultZoom As %Integer; 22 | 23 | /// Возможность drill down 24 | Property CanDrillDown As %Boolean [ InitialExpression = "0", Required ]; 25 | 26 | /// Название адм. центра 27 | Property CenterName As %String; 28 | 29 | /// Город является административным центром 30 | Property SpecialIcon As %Boolean [ InitialExpression = "0", Required ]; 31 | 32 | /// Уровень в иерархии 33 | Property HLevel As %Integer [ Required ]; 34 | 35 | /// Прозрачность обводки полигона после углубления, 1 - 100% видимость, 0 - это не полигон. 36 | /// Значение 0 - только у городов(маркеров) 37 | Property PolygonStrokeOpacity As %Float(MAXVAL = 1, MINVAL = 0) [ InitialExpression = 0, Required ]; 38 | 39 | Index GuidIndex On Guid [ IdKey, Unique ]; 40 | 41 | Storage Default 42 | { 43 | 44 | 45 | %%CLASSNAME 46 | 47 | 48 | Name 49 | 50 | 51 | ParentName 52 | 53 | 54 | GrandParentName 55 | 56 | 57 | OKATO 58 | 59 | 60 | ParentOKATO 61 | 62 | 63 | MainCity 64 | 65 | 66 | Latitude 67 | 68 | 69 | Longitude 70 | 71 | 72 | DefaultZoom 73 | 74 | 75 | CanDrillDown 76 | 77 | 78 | HLevelRF 79 | 80 | 81 | Guid 82 | 83 | 84 | ParentGuid 85 | 86 | 87 | Area 88 | 89 | 90 | OKTMO 91 | 92 | 93 | NameCenter 94 | 95 | 96 | GuidCenter 97 | 98 | 99 | HLevel 100 | 101 | 102 | CenterName 103 | 104 | 105 | IsCenter 106 | 107 | 108 | SpecialIcon 109 | 110 | 111 | PolygonStrokeOpacity 112 | 113 | 114 | ^RF.RegionD 115 | RegionDefaultData 116 | 100000 117 | ^RF.RegionD 118 | ^RF.RegionI 119 | ^RF.RegionS 120 | %Storage.Persistent 121 | } 122 | 123 | } 124 | 125 | -------------------------------------------------------------------------------- /src/dfi/UA21/population.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/dfi/UK/UKMap.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 54.89 9 | -2.93 10 | 4 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/dfi/UA/Map of Ukraina.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 49.01 9 | 31.4 10 | 5 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/dfi/CZ/CzMap.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 50.074395 9 | 14.437578 10 | 6 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/dfi/Russia/Map of Perm Krai.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 58.97 9 | 56.35 10 | 5 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/dfi/SE/SeMap.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 63.489229 9 | 16.235400 10 | 4 11 | 12 | 13 | 14 | 15 | 1 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/dfi/RSA/RsaMap.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -28.742243 11 | 24.758281 12 | 4 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/ID/BI/IDCube.cls: -------------------------------------------------------------------------------- 1 | /// 2 | Class ID.BI.IDCube Extends %DeepSee.CubeDefinition [ DependsOn = ID.Region, ProcedureBlock ] 3 | { 4 | 5 | /// Cube definition from Architect. 6 | XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ] 7 | { 8 | 9 | 29 | 30 | 31 | 32 | } 33 | 34 | ClassMethod GetColor(min, max, value) As %String 35 | { 36 | if ('value) return "rgb(0,0,0)" 37 | 38 | // Крайние границы: красный и зеленый, цвет для середины - желтый 39 | set middle = (max + min) / 2 40 | 41 | if (value <= middle) 42 | { 43 | set redPart = (value - min) / (middle - min) 44 | return "rgb(" _ (255 * redPart\1) _ ",255, 0)" 45 | } 46 | else 47 | { 48 | set greenPart = (max - value) / (max - middle) 49 | return "rgb(255," _(255 * greenPart\1) _ ", 0)" 50 | } 51 | } 52 | 53 | ClassMethod GetValue(guid, type) As %Integer 54 | { 55 | 56 | //b "L" 57 | //type=1 - population 58 | //type=2 - area 59 | // density 60 | s region=##class(ID.Region).%OpenId(guid) 61 | if $IsObject(region) { 62 | s parameter=##class(ID.ParameterValue).RegionParameterIndexOpen(region.Guid,type) 63 | if $IsObject(parameter) return parameter.Value} 64 | return "" 65 | } 66 | 67 | Parameter DOMAIN; 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/BG/BI/BGCube.cls: -------------------------------------------------------------------------------- 1 | /// 2 | Class BG.BI.BGCube Extends %DeepSee.CubeDefinition [ DependsOn = BG.Region, ProcedureBlock ] 3 | { 4 | 5 | /// Cube definition from Architect. 6 | XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ] 7 | { 8 | 9 | 29 | 30 | 31 | 32 | } 33 | 34 | ClassMethod GetColor(min, max, value) As %String 35 | { 36 | if ('value) return "rgb(0,0,0)" 37 | 38 | // Крайние границы: красный и зеленый, цвет для середины - желтый 39 | set middle = (max + min) / 2 40 | 41 | if (value <= middle) 42 | { 43 | set redPart = (value - min) / (middle - min) 44 | return "rgb(" _ (255 * redPart\1) _ ",255, 0)" 45 | } 46 | else 47 | { 48 | set greenPart = (max - value) / (max - middle) 49 | return "rgb(255," _(255 * greenPart\1) _ ", 0)" 50 | } 51 | } 52 | 53 | ClassMethod GetValue(guid, type) As %Integer 54 | { 55 | 56 | //b "L" 57 | //type=1 - population 58 | //type=2 - area 59 | // density 60 | s region=##class(BG.Region).%OpenId(guid) 61 | if $IsObject(region) { 62 | s parameter=##class(BG.ParameterValue).RegionParameterIndexOpen(region.Guid,type) 63 | if $IsObject(parameter) return parameter.Value} 64 | return "" 65 | } 66 | 67 | Parameter DOMAIN; 68 | 69 | } 70 | 71 | -------------------------------------------------------------------------------- /src/KZ/BI/KZCube.cls: -------------------------------------------------------------------------------- 1 | /// 2 | Class KZ.BI.KZCube Extends %DeepSee.CubeDefinition [ DependsOn = KZ.Region, ProcedureBlock ] 3 | { 4 | 5 | /// Cube definition from Architect. 6 | XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ] 7 | { 8 | 9 | 29 | 30 | 31 | 32 | } 33 | 34 | ClassMethod GetColor(min, max, value) As %String 35 | { 36 | if ('value) return "rgb(0,0,0)" 37 | 38 | // Крайние границы: красный и зеленый, цвет для середины - желтый 39 | set middle = (max + min) / 2 40 | 41 | if (value <= middle) 42 | { 43 | set redPart = (value - min) / (middle - min) 44 | return "rgb(" _ (255 * redPart\1) _ ",255, 0)" 45 | } 46 | else 47 | { 48 | set greenPart = (max - value) / (max - middle) 49 | return "rgb(255," _(255 * greenPart\1) _ ", 0)" 50 | } 51 | } 52 | 53 | ClassMethod GetValue(guid, type) As %Integer 54 | { 55 | 56 | //b "L" 57 | //type=1 - population 58 | //type=2 - area 59 | // density 60 | s region=##class(KZ.Region).%OpenId(guid) 61 | if $IsObject(region) { 62 | s parameter=##class(KZ.ParameterValue).RegionParameterIndexOpen(region.Guid,type) 63 | if $IsObject(parameter) return parameter.Value} 64 | return "" 65 | } 66 | 67 | Parameter DOMAIN; 68 | 69 | } 70 | 71 | -------------------------------------------------------------------------------- /src/UA/BI/UACube.cls: -------------------------------------------------------------------------------- 1 | /// 2 | Class UA.BI.UACube Extends %DeepSee.CubeDefinition [ DependsOn = UA.Region, ProcedureBlock ] 3 | { 4 | 5 | /// Cube definition from Architect. 6 | XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ] 7 | { 8 | 9 | 29 | 30 | 31 | 32 | } 33 | 34 | ClassMethod GetColor(min, max, value) As %String 35 | { 36 | if ('value) return "rgb(0,0,0)" 37 | 38 | // Крайние границы: красный и зеленый, цвет для середины - желтый 39 | set middle = (max + min) / 2 40 | 41 | if (value <= middle) 42 | { 43 | set redPart = (value - min) / (middle - min) 44 | return "rgb(" _ (255 * redPart\1) _ ",255, 0)" 45 | } 46 | else 47 | { 48 | set greenPart = (max - value) / (max - middle) 49 | return "rgb(255," _(255 * greenPart\1) _ ", 0)" 50 | } 51 | } 52 | 53 | ClassMethod GetValue(guid, type) As %Integer 54 | { 55 | 56 | //b "L" 57 | //type=1 - population 58 | //type=2 - area 59 | // density 60 | s region=##class(UA.Region).%OpenId(guid) 61 | if $IsObject(region) { 62 | s parameter=##class(UA.ParameterValue).RegionParameterIndexOpen(region.Guid,type) 63 | if $IsObject(parameter) return parameter.Value} 64 | return "" 65 | } 66 | 67 | Parameter DOMAIN; 68 | 69 | } 70 | 71 | -------------------------------------------------------------------------------- /src/USA/Borders.cls: -------------------------------------------------------------------------------- 1 | /// Borders for polygons 2 | Class USA.Borders Extends %Persistent 3 | { 4 | 5 | /// ParentRegion guid or string-'NULL' if level=0 6 | Property ParentRegion As %String [ Required ]; 7 | 8 | /// Parameter 9 | Property Parameter As USA.Parameter [ Required ]; 10 | 11 | /// Level 12 | Property HLevel As %Integer [ Required ]; 13 | 14 | Property Minimum As %Integer; 15 | 16 | Property Maximum As %Integer; 17 | 18 | Index BordersIdx On (ParentRegion, Parameter, HLevel) [ Unique ]; 19 | 20 | /// Get a set of borders values for polygons whose parent GUID = parentRegionGuid 21 | ClassMethod GetBorders(paramId As %String, hLevel As %Integer, parentRegionGuid As %String) As %String 22 | { 23 | set borderMax = 10000 24 | set borderMin = 0 25 | set unitName = "-" 26 | 27 | if (parentRegionGuid="") set parentRegionGuid = "NULL" 28 | 29 | set border = "" 30 | 31 | try{ 32 | if (..BordersIdxExists(parentRegionGuid, paramId, hLevel) = 1){ 33 | set border = ..BordersIdxOpen(parentRegionGuid, paramId, hLevel) 34 | } 35 | else{ 36 | set minVal=0, maxVal=10000 37 | 38 | if (parentRegionGuid = "NULL"){ 39 | &sql(SELECT Min(Value), Max(Value) INTO :minVal,:maxVal 40 | FROM USA.Region as reg INNER JOIN 41 | USA.ParameterValue as pv ON reg.ID = pv.Area 42 | WHERE reg.HLevel=:hLevel AND pv.Parameter=:paramId ) 43 | } 44 | else{ 45 | &sql(SELECT Min(Value), Max(Value) INTO :minVal,:maxVal 46 | FROM USA.Region as reg INNER JOIN 47 | USA.ParameterValue as pv ON reg.ID = pv.Area 48 | WHERE reg.HLevel=:hLevel AND pv.Parameter=:paramId AND reg.ParentRegion=:parentRegionGuid) 49 | } 50 | 51 | set border = ..%New() 52 | set border.ParentRegion = parentRegionGuid 53 | set border.Parameter = ##class(USA.Parameter).%OpenId(paramId) 54 | set border.HLevel = hLevel 55 | set border.Maximum = maxVal 56 | set border.Minimum = minVal 57 | do border.%Save() 58 | } 59 | 60 | set borderMin = border.Minimum 61 | set borderMax = border.Maximum 62 | set unitName = border.Parameter.UnitName 63 | } 64 | catch 65 | {} 66 | 67 | quit borderMin_";"_borderMax_";"_unitName 68 | } 69 | 70 | /// Update values for border 71 | ClassMethod SetBorders(paramId As %String, level As %Integer, parentRegionGuid As %String, min As %Integer, max As %Integer) As %Status 72 | { 73 | set st = $$$OK 74 | try{ 75 | if (parentRegionGuid="") set parentRegionGuid = "NULL" 76 | set brd = ..BordersIdxOpen(parentRegionGuid, paramId, level) 77 | set brd.Maximum = max 78 | set brd.Minimum = min 79 | set st = brd.%Save() 80 | } 81 | catch(ex){ 82 | set st = ex.AsStatus() 83 | } 84 | quit st 85 | } 86 | 87 | Storage Default 88 | { 89 | 90 | 91 | %%CLASSNAME 92 | 93 | 94 | ParentRegion 95 | 96 | 97 | Parameter 98 | 99 | 100 | HLevel 101 | 102 | 103 | Minimum 104 | 105 | 106 | Maximum 107 | 108 | 109 | ^USA.BordersD 110 | BordersDefaultData 111 | 100000 112 | ^USA.BordersD 113 | ^USA.BordersI 114 | ^USA.BordersS 115 | %Storage.Persistent 116 | } 117 | 118 | } 119 | 120 | -------------------------------------------------------------------------------- /src/CZ/BI/CZCube.cls: -------------------------------------------------------------------------------- 1 | /// 2 | Class CZ.BI.CZCube Extends %DeepSee.CubeDefinition [ DependsOn = CZ.Region, ProcedureBlock ] 3 | { 4 | 5 | /// Cube definition from Architect. 6 | XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ] 7 | { 8 | 9 | 24 | 25 | 26 | } 27 | 28 | ClassMethod GetColor(min, max, value) As %String 29 | { 30 | if ('value) return "rgb(0,0,0)" 31 | 32 | // Крайние границы: красный и зеленый, цвет для середины - желтый 33 | set middle = (max + min) / 2 34 | 35 | if (value <= middle) 36 | { 37 | set redPart = (value - min) / (middle - min) 38 | return "rgb(" _ (255 * redPart\1) _ ",255, 0)" 39 | } 40 | else 41 | { 42 | set greenPart = (max - value) / (max - middle) 43 | return "rgb(255," _(255 * greenPart\1) _ ", 0)" 44 | } 45 | } 46 | 47 | ClassMethod GetValue(guid, type) As %Integer 48 | { 49 | 50 | //b "L" 51 | //type=1 - population 52 | //type=2 - area 53 | // density 54 | s region=##class(CZ.Region).%OpenId(guid) 55 | if $IsObject(region) { 56 | s parameter=##class(CZ.ParameterValue).RegionParameterIndexOpen(region.Guid,type) 57 | if $IsObject(parameter) return parameter.Value} 58 | return "" 59 | } 60 | 61 | Parameter DOMAIN; 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/SE/BI/SECube.cls: -------------------------------------------------------------------------------- 1 | /// 2 | Class SE.BI.SECube Extends %DeepSee.CubeDefinition [ DependsOn = SE.Region, ProcedureBlock ] 3 | { 4 | 5 | /// Cube definition from Architect. 6 | XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ] 7 | { 8 | 9 | 24 | 25 | 26 | } 27 | 28 | ClassMethod GetColor(min, max, value) As %String 29 | { 30 | if ('value) return "rgb(0,0,0)" 31 | 32 | // Крайние границы: красный и зеленый, цвет для середины - желтый 33 | set middle = (max + min) / 2 34 | 35 | if (value <= middle) 36 | { 37 | set redPart = (value - min) / (middle - min) 38 | return "rgb(" _ (255 * redPart\1) _ ",255, 0)" 39 | } 40 | else 41 | { 42 | set greenPart = (max - value) / (max - middle) 43 | return "rgb(255," _(255 * greenPart\1) _ ", 0)" 44 | } 45 | } 46 | 47 | ClassMethod GetValue(guid, type) As %Integer 48 | { 49 | 50 | //b "L" 51 | //type=1 - population 52 | //type=2 - area 53 | // density 54 | s region=##class(SE.Region).%OpenId(guid) 55 | if $IsObject(region) { 56 | s parameter=##class(SE.ParameterValue).RegionParameterIndexOpen(region.Guid,type) 57 | if $IsObject(parameter) return parameter.Value} 58 | return "" 59 | } 60 | 61 | Parameter DOMAIN; 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/UK/BI/UKCube.cls: -------------------------------------------------------------------------------- 1 | /// 2 | Class UK.BI.UKCube Extends %DeepSee.CubeDefinition [ DependsOn = SE.Region, ProcedureBlock ] 3 | { 4 | 5 | /// Cube definition from Architect. 6 | XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ] 7 | { 8 | 9 | 24 | 25 | 26 | } 27 | 28 | ClassMethod GetColor(min, max, value) As %String 29 | { 30 | if ('value) return "rgb(0,0,0)" 31 | 32 | // Крайние границы: красный и зеленый, цвет для середины - желтый 33 | set middle = (max + min) / 2 34 | 35 | if (value <= middle) 36 | { 37 | set redPart = (value - min) / (middle - min) 38 | return "rgb(" _ (255 * redPart\1) _ ",255, 0)" 39 | } 40 | else 41 | { 42 | set greenPart = (max - value) / (max - middle) 43 | return "rgb(255," _(255 * greenPart\1) _ ", 0)" 44 | } 45 | } 46 | 47 | ClassMethod GetValue(guid, type) As %Integer 48 | { 49 | 50 | //b "L" 51 | //type=1 - population 52 | //type=2 - area 53 | // density 54 | s region=##class(UK.Region).%OpenId(guid) 55 | if $IsObject(region) { 56 | s parameter=##class(UK.ParameterValue).RegionParameterIndexOpen(region.Guid,type) 57 | if $IsObject(parameter) return parameter.Value} 58 | return "" 59 | } 60 | 61 | Parameter DOMAIN; 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/RSA/BI/RSACube.cls: -------------------------------------------------------------------------------- 1 | /// 2 | Class RSA.BI.RSACube Extends %DeepSee.CubeDefinition [ DependsOn = RSA.Region, ProcedureBlock ] 3 | { 4 | 5 | /// Cube definition from Architect. 6 | XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ] 7 | { 8 | 9 | 24 | 25 | 26 | } 27 | 28 | ClassMethod GetColor(min, max, value) As %String 29 | { 30 | if ('value) return "rgb(0,0,0)" 31 | 32 | // Крайние границы: красный и зеленый, цвет для середины - желтый 33 | set middle = (max + min) / 2 34 | 35 | if (value <= middle) 36 | { 37 | set redPart = (value - min) / (middle - min) 38 | return "rgb(" _ (255 * redPart\1) _ ",255, 0)" 39 | } 40 | else 41 | { 42 | set greenPart = (max - value) / (max - middle) 43 | return "rgb(255," _(255 * greenPart\1) _ ", 0)" 44 | } 45 | } 46 | 47 | ClassMethod GetValue(guid, type) As %Integer 48 | { 49 | 50 | //b "L" 51 | //type=1 - population 52 | //type=2 - area 53 | // density 54 | s region=##class(RSA.Region).%OpenId(guid) 55 | if $IsObject(region) { 56 | s parameter=##class(RSA.ParameterValue).RegionParameterIndexOpen(region.Guid,type) 57 | if $IsObject(parameter) return parameter.Value} 58 | return "" 59 | } 60 | 61 | Parameter DOMAIN; 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/dfi/ID/Map of Indonesia.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | 9 | 10 | 11 | 0.7893 12 | 113.9213 13 | 4 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/dfi/KZ/Map of Kazakhstan.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | 9 | 10 | 11 | 48.18 12 | 67.129 13 | 4 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/dfi/ID/Population Map Mini Dist.pivot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/dfi/KZ/Population Map Mini Dist.pivot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/dfi/USA/Elections.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | 9 | 10 | false 11 | 12 | 13 | false 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/dfi/Russia/Map of Khabarovsk krai.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | 9 | 10 | false 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/dfi/UA21/population.pivot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/dfi/SAKH/Indicator.pivot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/dfi/KHAB/Indicator.pivot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/dfi/UA21/UA21-population.pivot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/FIN/BI/FINCube.cls: -------------------------------------------------------------------------------- 1 | /// 2 | Class FIN.BI.FINCube Extends %DeepSee.CubeDefinition [ DependsOn = FIN.Region, ProcedureBlock ] 3 | { 4 | 5 | /// Cube definition from Architect. 6 | XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ] 7 | { 8 | 9 | 37 | 38 | undefined 39 | 40 | 41 | } 42 | 43 | ClassMethod GetColor(min, max, value) As %String 44 | { 45 | if ('value) return "rgb(0,0,0)" 46 | 47 | // Крайние границы: красный и зеленый, цвет для середины - желтый 48 | set middle = (max + min) / 2 49 | 50 | if (value <= middle) 51 | { 52 | set redPart = (value - min) / (middle - min) 53 | return "rgb(" _ (255 * redPart\1) _ ",255, 0)" 54 | } 55 | else 56 | { 57 | set greenPart = (max - value) / (max - middle) 58 | return "rgb(255," _(255 * greenPart\1) _ ", 0)" 59 | } 60 | } 61 | 62 | ClassMethod GetValue(guid, type) As %Integer 63 | { 64 | 65 | //b "L" 66 | //type=1 - population 67 | //type=2 - area 68 | // density 69 | s region=##class(FIN.Region).%OpenId(guid) 70 | if $IsObject(region) { 71 | s parameter=##class(FIN.ParameterValue).RegionParameterIndexOpen(region.Guid,type) 72 | if $IsObject(parameter) return parameter.Value} 73 | return "" 74 | } 75 | 76 | Parameter DOMAIN; 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /src/dfi/SAKH/Map.pivot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/dfi/USA/USA Map Standard.dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | 9 | 10 | false 11 | 12 | 13 | false 14 | 15 | 16 | 17 | 6 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/dfi/USA/USMapDensity.pivot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/dfi/USA/Indicator.pivot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | --------------------------------------------------------------------------------