{"action":"created","comment":{"url":"https://api.github.com/repos/muccg/rdrf/pulls/comments/63319137","id":63319137,"diff_hunk":"@@ -0,0 +1,97 @@\n+from collections import namedtuple\n+\n+from registry.genetic import models as genemodels\n+from registry.patients import models as patientmodels\n+from rdrf import models\n+from . import model_exporters, datagroup_exporters, mongo_collection_exporters\n+\n+\n+class GroupDefinition(namedtuple('GroupDefinition', ['name', 'dirname', 'datagroups', 'models', 'collections'])):\n+    def __new__(cls, name, dirname, datagroups=tuple(), models=tuple(), collections=tuple()):\n+        return super(GroupDefinition, cls).__new__(cls, name, dirname, datagroups, models, collections)\n+\n+\n+ExporterCatalogue = namedtuple('Catalogue', ['datagroups', 'models', 'mongo_collections'])\n+ExportDefinition = namedtuple('ExportDefinition', ['exporters_catalogue', 'datagroups'])\n+\n+\n+_MAIN_CATALOGUE = ExporterCatalogue(\n+        datagroup_exporters.catalogue,\n+        model_exporters.catalogue,\n+        mongo_collection_exporters.catalogue)\n+\n+_CDE_GROUP = GroupDefinition(\n+    name='CDEs',\n+    dirname='CDE',\n+    models = (\n+        models.CDEPermittedValue,\n+        models.CDEPermittedValueGroup,\n+        models.CommonDataElement,\n+    ))\n+\n+_REFDATA_GROUP = GroupDefinition(\n+    name='Reference Data',\n+    dirname='reference_data',\n+    models=(\n+        genemodels.Gene,\n+        genemodels.Laboratory,\n+        genemodels.Technique,\n+\n+        patientmodels.State,\n+        patientmodels.NextOfKinRelationship,\n+        patientmodels.AddressType,\n+    ))\n+\n+\n+# Export definitons for different type of exports\n+\n+\n+CDE_EXPORT_DEFINITION = ExportDefinition(\n+    exporters_catalogue=_MAIN_CATALOGUE,\n+    datagroups=(_CDE_GROUP,)\n+)\n+\n+REFDATA_EXPORT_DEFINITION = ExportDefinition(\n+    exporters_catalogue=_MAIN_CATALOGUE,\n+    datagroups=(_REFDATA_GROUP, _CDE_GROUP)\n+)\n+\n+REGISTRY_EXPORT_DEFINITION = ExportDefinition(\n+    exporters_catalogue=ExporterCatalogue(\n+        datagroup_exporters.catalogue,\n+        model_exporters.registry_catalogue,\n+        mongo_collection_exporters.catalogue,),\n+    datagroups=(\n+        _REFDATA_GROUP,\n+        _CDE_GROUP,\n+        GroupDefinition(\n+            name='Registry Definition',\n+            dirname='registry_definition',\n+            models = (\n+                models.Registry,\n+                models.RegistryForm,\n+                models.AdjudicationDefinition,\n+                models.Section,\n+        )),\n+        GroupDefinition(\n+            name='Registry Data',\n+            dirname='registry_data',\n+            datagroups=(\n+                GroupDefinition(\n+                    name='Demographic Data',\n+                    dirname='demographic_data',\n+                    models = (\n+                        patientmodels.Patient,\n+                )),\n+                GroupDefinition(\n+                    name='MongoDB Data',\n+                    dirname='mongodb_data',\n+                    collections = (\n+                        'cdes',\n+                        'history',\n+                        'progress',","path":"rdrf/rdrf/export/definitions.py","position":92,"original_position":92,"commit_id":"5a8783c92ef25116f4536b5d1f25e0d28d0312cf","original_commit_id":"5a8783c92ef25116f4536b5d1f25e0d28d0312cf","user":{"login":"id2359","id":1163895,"avatar_url":"https://avatars.githubusercontent.com/u/1163895?v=3","gravatar_id":"","url":"https://api.github.com/users/id2359","html_url":"https://github.com/id2359","followers_url":"https://api.github.com/users/id2359/followers","following_url":"https://api.github.com/users/id2359/following{/other_user}","gists_url":"https://api.github.com/users/id2359/gists{/gist_id}","starred_url":"https://api.github.com/users/id2359/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/id2359/subscriptions","organizations_url":"https://api.github.com/users/id2359/orgs","repos_url":"https://api.github.com/users/id2359/repos","events_url":"https://api.github.com/users/id2359/events{/privacy}","received_events_url":"https://api.github.com/users/id2359/received_events","type":"User","site_admin":false},"body":"there's a registry specific fields collection called \"registry_specific_patient_data\" also in mongo - used by FH only currently","created_at":"2016-05-16T07:43:17Z","updated_at":"2016-05-16T07:43:17Z","html_url":"https://github.com/muccg/rdrf/pull/6#discussion_r63319137","pull_request_url":"https://api.github.com/repos/muccg/rdrf/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/muccg/rdrf/pulls/comments/63319137"},"html":{"href":"https://github.com/muccg/rdrf/pull/6#discussion_r63319137"},"pull_request":{"href":"https://api.github.com/repos/muccg/rdrf/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/muccg/rdrf/pulls/6","id":70156771,"html_url":"https://github.com/muccg/rdrf/pull/6","diff_url":"https://github.com/muccg/rdrf/pull/6.diff","patch_url":"https://github.com/muccg/rdrf/pull/6.patch","issue_url":"https://api.github.com/repos/muccg/rdrf/issues/6","number":6,"state":"open","locked":false,"title":"Exporter initial version.","user":{"login":"sztamas","id":973139,"avatar_url":"https://avatars.githubusercontent.com/u/973139?v=3","gravatar_id":"","url":"https://api.github.com/users/sztamas","html_url":"https://github.com/sztamas","followers_url":"https://api.github.com/users/sztamas/followers","following_url":"https://api.github.com/users/sztamas/following{/other_user}","gists_url":"https://api.github.com/users/sztamas/gists{/gist_id}","starred_url":"https://api.github.com/users/sztamas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sztamas/subscriptions","organizations_url":"https://api.github.com/users/sztamas/orgs","repos_url":"https://api.github.com/users/sztamas/repos","events_url":"https://api.github.com/users/sztamas/events{/privacy}","received_events_url":"https://api.github.com/users/sztamas/received_events","type":"User","site_admin":false},"body":"Initial version of the exporter for review.\r\nNot all models are exported currently but would like to get some feedback on it.\r\nIn the meantime I will work on import then complete the export.\r\n\r\nThanks","created_at":"2016-05-16T06:50:03Z","updated_at":"2016-05-16T07:43:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4140cc55eb26ae8b172374e3b08e2afaf760b0e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/muccg/rdrf/pulls/6/commits","review_comments_url":"https://api.github.com/repos/muccg/rdrf/pulls/6/comments","review_comment_url":"https://api.github.com/repos/muccg/rdrf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/muccg/rdrf/issues/6/comments","statuses_url":"https://api.github.com/repos/muccg/rdrf/statuses/5a8783c92ef25116f4536b5d1f25e0d28d0312cf","head":{"label":"muccg:import_export","ref":"import_export","sha":"5a8783c92ef25116f4536b5d1f25e0d28d0312cf","user":{"login":"muccg","id":2595123,"avatar_url":"https://avatars.githubusercontent.com/u/2595123?v=3","gravatar_id":"","url":"https://api.github.com/users/muccg","html_url":"https://github.com/muccg","followers_url":"https://api.github.com/users/muccg/followers","following_url":"https://api.github.com/users/muccg/following{/other_user}","gists_url":"https://api.github.com/users/muccg/gists{/gist_id}","starred_url":"https://api.github.com/users/muccg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muccg/subscriptions","organizations_url":"https://api.github.com/users/muccg/orgs","repos_url":"https://api.github.com/users/muccg/repos","events_url":"https://api.github.com/users/muccg/events{/privacy}","received_events_url":"https://api.github.com/users/muccg/received_events","type":"Organization","site_admin":false},"repo":{"id":48199721,"name":"rdrf","full_name":"muccg/rdrf","owner":{"login":"muccg","id":2595123,"avatar_url":"https://avatars.githubusercontent.com/u/2595123?v=3","gravatar_id":"","url":"https://api.github.com/users/muccg","html_url":"https://github.com/muccg","followers_url":"https://api.github.com/users/muccg/followers","following_url":"https://api.github.com/users/muccg/following{/other_user}","gists_url":"https://api.github.com/users/muccg/gists{/gist_id}","starred_url":"https://api.github.com/users/muccg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muccg/subscriptions","organizations_url":"https://api.github.com/users/muccg/orgs","repos_url":"https://api.github.com/users/muccg/repos","events_url":"https://api.github.com/users/muccg/events{/privacy}","received_events_url":"https://api.github.com/users/muccg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/muccg/rdrf","description":"The Rare Disease Registry Framework (RDRF) is an open source tool for the creation of web-based patient registries.","fork":false,"url":"https://api.github.com/repos/muccg/rdrf","forks_url":"https://api.github.com/repos/muccg/rdrf/forks","keys_url":"https://api.github.com/repos/muccg/rdrf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/muccg/rdrf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/muccg/rdrf/teams","hooks_url":"https://api.github.com/repos/muccg/rdrf/hooks","issue_events_url":"https://api.github.com/repos/muccg/rdrf/issues/events{/number}","events_url":"https://api.github.com/repos/muccg/rdrf/events","assignees_url":"https://api.github.com/repos/muccg/rdrf/assignees{/user}","branches_url":"https://api.github.com/repos/muccg/rdrf/branches{/branch}","tags_url":"https://api.github.com/repos/muccg/rdrf/tags","blobs_url":"https://api.github.com/repos/muccg/rdrf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/muccg/rdrf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/muccg/rdrf/git/refs{/sha}","trees_url":"https://api.github.com/repos/muccg/rdrf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/muccg/rdrf/statuses/{sha}","languages_url":"https://api.github.com/repos/muccg/rdrf/languages","stargazers_url":"https://api.github.com/repos/muccg/rdrf/stargazers","contributors_url":"https://api.github.com/repos/muccg/rdrf/contributors","subscribers_url":"https://api.github.com/repos/muccg/rdrf/subscribers","subscription_url":"https://api.github.com/repos/muccg/rdrf/subscription","commits_url":"https://api.github.com/repos/muccg/rdrf/commits{/sha}","git_commits_url":"https://api.github.com/repos/muccg/rdrf/git/commits{/sha}","comments_url":"https://api.github.com/repos/muccg/rdrf/comments{/number}","issue_comment_url":"https://api.github.com/repos/muccg/rdrf/issues/comments{/number}","contents_url":"https://api.github.com/repos/muccg/rdrf/contents/{+path}","compare_url":"https://api.github.com/repos/muccg/rdrf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/muccg/rdrf/merges","archive_url":"https://api.github.com/repos/muccg/rdrf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/muccg/rdrf/downloads","issues_url":"https://api.github.com/repos/muccg/rdrf/issues{/number}","pulls_url":"https://api.github.com/repos/muccg/rdrf/pulls{/number}","milestones_url":"https://api.github.com/repos/muccg/rdrf/milestones{/number}","notifications_url":"https://api.github.com/repos/muccg/rdrf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/muccg/rdrf/labels{/name}","releases_url":"https://api.github.com/repos/muccg/rdrf/releases{/id}","deployments_url":"https://api.github.com/repos/muccg/rdrf/deployments","created_at":"2015-12-17T21:41:17Z","updated_at":"2016-03-12T11:12:52Z","pushed_at":"2016-05-16T06:53:08Z","git_url":"git://github.com/muccg/rdrf.git","ssh_url":"git@github.com:muccg/rdrf.git","clone_url":"https://github.com/muccg/rdrf.git","svn_url":"https://github.com/muccg/rdrf","homepage":null,"size":31334,"stargazers_count":2,"watchers_count":2,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":2,"default_branch":"next_release"}},"base":{"label":"muccg:next_release","ref":"next_release","sha":"7d6ce7f4c9b0838e8e6d989369ff93687a0552c5","user":{"login":"muccg","id":2595123,"avatar_url":"https://avatars.githubusercontent.com/u/2595123?v=3","gravatar_id":"","url":"https://api.github.com/users/muccg","html_url":"https://github.com/muccg","followers_url":"https://api.github.com/users/muccg/followers","following_url":"https://api.github.com/users/muccg/following{/other_user}","gists_url":"https://api.github.com/users/muccg/gists{/gist_id}","starred_url":"https://api.github.com/users/muccg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muccg/subscriptions","organizations_url":"https://api.github.com/users/muccg/orgs","repos_url":"https://api.github.com/users/muccg/repos","events_url":"https://api.github.com/users/muccg/events{/privacy}","received_events_url":"https://api.github.com/users/muccg/received_events","type":"Organization","site_admin":false},"repo":{"id":48199721,"name":"rdrf","full_name":"muccg/rdrf","owner":{"login":"muccg","id":2595123,"avatar_url":"https://avatars.githubusercontent.com/u/2595123?v=3","gravatar_id":"","url":"https://api.github.com/users/muccg","html_url":"https://github.com/muccg","followers_url":"https://api.github.com/users/muccg/followers","following_url":"https://api.github.com/users/muccg/following{/other_user}","gists_url":"https://api.github.com/users/muccg/gists{/gist_id}","starred_url":"https://api.github.com/users/muccg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muccg/subscriptions","organizations_url":"https://api.github.com/users/muccg/orgs","repos_url":"https://api.github.com/users/muccg/repos","events_url":"https://api.github.com/users/muccg/events{/privacy}","received_events_url":"https://api.github.com/users/muccg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/muccg/rdrf","description":"The Rare Disease Registry Framework (RDRF) is an open source tool for the creation of web-based patient registries.","fork":false,"url":"https://api.github.com/repos/muccg/rdrf","forks_url":"https://api.github.com/repos/muccg/rdrf/forks","keys_url":"https://api.github.com/repos/muccg/rdrf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/muccg/rdrf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/muccg/rdrf/teams","hooks_url":"https://api.github.com/repos/muccg/rdrf/hooks","issue_events_url":"https://api.github.com/repos/muccg/rdrf/issues/events{/number}","events_url":"https://api.github.com/repos/muccg/rdrf/events","assignees_url":"https://api.github.com/repos/muccg/rdrf/assignees{/user}","branches_url":"https://api.github.com/repos/muccg/rdrf/branches{/branch}","tags_url":"https://api.github.com/repos/muccg/rdrf/tags","blobs_url":"https://api.github.com/repos/muccg/rdrf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/muccg/rdrf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/muccg/rdrf/git/refs{/sha}","trees_url":"https://api.github.com/repos/muccg/rdrf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/muccg/rdrf/statuses/{sha}","languages_url":"https://api.github.com/repos/muccg/rdrf/languages","stargazers_url":"https://api.github.com/repos/muccg/rdrf/stargazers","contributors_url":"https://api.github.com/repos/muccg/rdrf/contributors","subscribers_url":"https://api.github.com/repos/muccg/rdrf/subscribers","subscription_url":"https://api.github.com/repos/muccg/rdrf/subscription","commits_url":"https://api.github.com/repos/muccg/rdrf/commits{/sha}","git_commits_url":"https://api.github.com/repos/muccg/rdrf/git/commits{/sha}","comments_url":"https://api.github.com/repos/muccg/rdrf/comments{/number}","issue_comment_url":"https://api.github.com/repos/muccg/rdrf/issues/comments{/number}","contents_url":"https://api.github.com/repos/muccg/rdrf/contents/{+path}","compare_url":"https://api.github.com/repos/muccg/rdrf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/muccg/rdrf/merges","archive_url":"https://api.github.com/repos/muccg/rdrf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/muccg/rdrf/downloads","issues_url":"https://api.github.com/repos/muccg/rdrf/issues{/number}","pulls_url":"https://api.github.com/repos/muccg/rdrf/pulls{/number}","milestones_url":"https://api.github.com/repos/muccg/rdrf/milestones{/number}","notifications_url":"https://api.github.com/repos/muccg/rdrf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/muccg/rdrf/labels{/name}","releases_url":"https://api.github.com/repos/muccg/rdrf/releases{/id}","deployments_url":"https://api.github.com/repos/muccg/rdrf/deployments","created_at":"2015-12-17T21:41:17Z","updated_at":"2016-03-12T11:12:52Z","pushed_at":"2016-05-16T06:53:08Z","git_url":"git://github.com/muccg/rdrf.git","ssh_url":"git@github.com:muccg/rdrf.git","clone_url":"https://github.com/muccg/rdrf.git","svn_url":"https://github.com/muccg/rdrf","homepage":null,"size":31334,"stargazers_count":2,"watchers_count":2,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":2,"default_branch":"next_release"}},"_links":{"self":{"href":"https://api.github.com/repos/muccg/rdrf/pulls/6"},"html":{"href":"https://github.com/muccg/rdrf/pull/6"},"issue":{"href":"https://api.github.com/repos/muccg/rdrf/issues/6"},"comments":{"href":"https://api.github.com/repos/muccg/rdrf/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/muccg/rdrf/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/muccg/rdrf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/muccg/rdrf/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/muccg/rdrf/statuses/5a8783c92ef25116f4536b5d1f25e0d28d0312cf"}}}}