{"action":"created","comment":{"url":"https://api.github.com/repos/cfpb/hmda-platform/pulls/comments/67089487","id":67089487,"diff_hunk":"@@ -1,66 +1,35 @@\n package hmda.validation.rules.lar.validity\n \n-import hmda.model.census.CBSATractLookup\n import hmda.model.fi.lar.LoanApplicationRegister\n import hmda.validation.dsl.Result\n import hmda.validation.rules.EditCheck\n import hmda.validation.dsl.PredicateCommon._\n import hmda.validation.dsl.PredicateSyntax._\n import hmda.validation.dsl.PredicateRegEx._\n+import hmda.validation.dsl.PredicateGeo._\n \n object V300 extends EditCheck[LoanApplicationRegister] {\n \n-  val cbsaTracts = CBSATractLookup.values\n-\n-  val validMsaCombination = cbsaTracts.map { cbsa =>\n-    (cbsa.geoIdMsa, cbsa.state, cbsa.county, cbsa.tractDecimal)\n-  }.toSet\n-\n-  val validMdCombination = cbsaTracts.map { cbsa =>\n-    (cbsa.metDivFp, cbsa.state, cbsa.county, cbsa.tractDecimal)\n-  }.toSet\n-\n-  val validStateCountyCombination = cbsaTracts.map { cbsa =>\n-    (cbsa.state, cbsa.county, cbsa.tractDecimal)\n-  }.toSet\n-\n-  val smallCounties = cbsaTracts\n-    .filter { cbsa => cbsa.smallCounty == 1 }\n-    .map { cbsa => (cbsa.state, cbsa.county) }\n-    .toSet\n-\n   override def name: String = \"V300\"\n \n   override def apply(lar: LoanApplicationRegister): Result = {\n \n     val msa = lar.geography.msa\n-    val state = lar.geography.state\n-    val county = lar.geography.county\n     val tract = lar.geography.tract\n \n-    val allCombination = (msa, state, county, tract)\n-    val stateCountyCombination = (state, county, tract)\n-\n-    val validCensusTractCombination = when(msa not equalTo(\"NA\")) {\n-      (allCombination is containedIn(validMsaCombination)) or\n-        (allCombination is containedIn(validMdCombination))\n-    }\n-\n-    val tractStateCountyCombination = when(msa is equalTo(\"NA\")) {\n-      stateCountyCombination is containedIn(validStateCountyCombination)\n-    }\n-\n     val validFormat = tract is validCensusTractFormat","path":"validation/src/main/scala/hmda/validation/rules/lar/validity/V300.scala","position":54,"original_position":54,"commit_id":"769f07cd8ba619b2efa81a3a13b1d87a4003c0ce","original_commit_id":"769f07cd8ba619b2efa81a3a13b1d87a4003c0ce","user":{"login":"lgdean","id":371459,"avatar_url":"https://avatars.githubusercontent.com/u/371459?v=3","gravatar_id":"","url":"https://api.github.com/users/lgdean","html_url":"https://github.com/lgdean","followers_url":"https://api.github.com/users/lgdean/followers","following_url":"https://api.github.com/users/lgdean/following{/other_user}","gists_url":"https://api.github.com/users/lgdean/gists{/gist_id}","starred_url":"https://api.github.com/users/lgdean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgdean/subscriptions","organizations_url":"https://api.github.com/users/lgdean/orgs","repos_url":"https://api.github.com/users/lgdean/repos","events_url":"https://api.github.com/users/lgdean/events{/privacy}","received_events_url":"https://api.github.com/users/lgdean/received_events","type":"User","site_admin":false},"body":"`validFormat` is calculated here, but then used in only one of the branches below.","created_at":"2016-06-15T02:08:53Z","updated_at":"2016-06-15T02:08:53Z","html_url":"https://github.com/cfpb/hmda-platform/pull/402#discussion_r67089487","pull_request_url":"https://api.github.com/repos/cfpb/hmda-platform/pulls/402","_links":{"self":{"href":"https://api.github.com/repos/cfpb/hmda-platform/pulls/comments/67089487"},"html":{"href":"https://github.com/cfpb/hmda-platform/pull/402#discussion_r67089487"},"pull_request":{"href":"https://api.github.com/repos/cfpb/hmda-platform/pulls/402"}}},"pull_request":{"url":"https://api.github.com/repos/cfpb/hmda-platform/pulls/402","id":73275634,"html_url":"https://github.com/cfpb/hmda-platform/pull/402","diff_url":"https://github.com/cfpb/hmda-platform/pull/402.diff","patch_url":"https://github.com/cfpb/hmda-platform/pull/402.patch","issue_url":"https://api.github.com/repos/cfpb/hmda-platform/issues/402","number":402,"state":"open","locked":false,"title":"Q029 + Predicate Geo","user":{"login":"kgudel","id":13244336,"avatar_url":"https://avatars.githubusercontent.com/u/13244336?v=3","gravatar_id":"","url":"https://api.github.com/users/kgudel","html_url":"https://github.com/kgudel","followers_url":"https://api.github.com/users/kgudel/followers","following_url":"https://api.github.com/users/kgudel/following{/other_user}","gists_url":"https://api.github.com/users/kgudel/gists{/gist_id}","starred_url":"https://api.github.com/users/kgudel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgudel/subscriptions","organizations_url":"https://api.github.com/users/kgudel/orgs","repos_url":"https://api.github.com/users/kgudel/repos","events_url":"https://api.github.com/users/kgudel/events{/privacy}","received_events_url":"https://api.github.com/users/kgudel/received_events","type":"User","site_admin":false},"body":"I'm putting this up as WIP because its a bit of a doozy and the code is all there given a correct interpretation. This pull request moves all the geo logic into PredicateGeo and closes #211 . \r\n\r\nFor Q029 I have coded against the intention, as I understand it, with help from Debbie, instead of against the edit text. The edit as I have coded should say similar to:\r\nIf the report state/county combination is in an MSA then MSA should not = \"NA\". I have removed the tract combination entirely because, in my understanding, MSAs are comprised of counties, and so all tracts within a county will be in the same MSA or they will all not be in an MSA. @debseidner it would be great if you could confirm my interpretation of the edit.\r\n\r\nI believe that this also closes #369 ","created_at":"2016-06-09T19:57:11Z","updated_at":"2016-06-15T02:08:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"830808334cc504cb9b9f6f5f6f7ec5dd5d689bcd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cfpb/hmda-platform/pulls/402/commits","review_comments_url":"https://api.github.com/repos/cfpb/hmda-platform/pulls/402/comments","review_comment_url":"https://api.github.com/repos/cfpb/hmda-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cfpb/hmda-platform/issues/402/comments","statuses_url":"https://api.github.com/repos/cfpb/hmda-platform/statuses/769f07cd8ba619b2efa81a3a13b1d87a4003c0ce","head":{"label":"kgudel:Q029","ref":"Q029","sha":"769f07cd8ba619b2efa81a3a13b1d87a4003c0ce","user":{"login":"kgudel","id":13244336,"avatar_url":"https://avatars.githubusercontent.com/u/13244336?v=3","gravatar_id":"","url":"https://api.github.com/users/kgudel","html_url":"https://github.com/kgudel","followers_url":"https://api.github.com/users/kgudel/followers","following_url":"https://api.github.com/users/kgudel/following{/other_user}","gists_url":"https://api.github.com/users/kgudel/gists{/gist_id}","starred_url":"https://api.github.com/users/kgudel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgudel/subscriptions","organizations_url":"https://api.github.com/users/kgudel/orgs","repos_url":"https://api.github.com/users/kgudel/repos","events_url":"https://api.github.com/users/kgudel/events{/privacy}","received_events_url":"https://api.github.com/users/kgudel/received_events","type":"User","site_admin":false},"repo":{"id":57915203,"name":"hmda-platform","full_name":"kgudel/hmda-platform","owner":{"login":"kgudel","id":13244336,"avatar_url":"https://avatars.githubusercontent.com/u/13244336?v=3","gravatar_id":"","url":"https://api.github.com/users/kgudel","html_url":"https://github.com/kgudel","followers_url":"https://api.github.com/users/kgudel/followers","following_url":"https://api.github.com/users/kgudel/following{/other_user}","gists_url":"https://api.github.com/users/kgudel/gists{/gist_id}","starred_url":"https://api.github.com/users/kgudel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgudel/subscriptions","organizations_url":"https://api.github.com/users/kgudel/orgs","repos_url":"https://api.github.com/users/kgudel/repos","events_url":"https://api.github.com/users/kgudel/events{/privacy}","received_events_url":"https://api.github.com/users/kgudel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kgudel/hmda-platform","description":"","fork":true,"url":"https://api.github.com/repos/kgudel/hmda-platform","forks_url":"https://api.github.com/repos/kgudel/hmda-platform/forks","keys_url":"https://api.github.com/repos/kgudel/hmda-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kgudel/hmda-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kgudel/hmda-platform/teams","hooks_url":"https://api.github.com/repos/kgudel/hmda-platform/hooks","issue_events_url":"https://api.github.com/repos/kgudel/hmda-platform/issues/events{/number}","events_url":"https://api.github.com/repos/kgudel/hmda-platform/events","assignees_url":"https://api.github.com/repos/kgudel/hmda-platform/assignees{/user}","branches_url":"https://api.github.com/repos/kgudel/hmda-platform/branches{/branch}","tags_url":"https://api.github.com/repos/kgudel/hmda-platform/tags","blobs_url":"https://api.github.com/repos/kgudel/hmda-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kgudel/hmda-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kgudel/hmda-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/kgudel/hmda-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kgudel/hmda-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/kgudel/hmda-platform/languages","stargazers_url":"https://api.github.com/repos/kgudel/hmda-platform/stargazers","contributors_url":"https://api.github.com/repos/kgudel/hmda-platform/contributors","subscribers_url":"https://api.github.com/repos/kgudel/hmda-platform/subscribers","subscription_url":"https://api.github.com/repos/kgudel/hmda-platform/subscription","commits_url":"https://api.github.com/repos/kgudel/hmda-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/kgudel/hmda-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/kgudel/hmda-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/kgudel/hmda-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/kgudel/hmda-platform/contents/{+path}","compare_url":"https://api.github.com/repos/kgudel/hmda-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kgudel/hmda-platform/merges","archive_url":"https://api.github.com/repos/kgudel/hmda-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kgudel/hmda-platform/downloads","issues_url":"https://api.github.com/repos/kgudel/hmda-platform/issues{/number}","pulls_url":"https://api.github.com/repos/kgudel/hmda-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/kgudel/hmda-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/kgudel/hmda-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kgudel/hmda-platform/labels{/name}","releases_url":"https://api.github.com/repos/kgudel/hmda-platform/releases{/id}","deployments_url":"https://api.github.com/repos/kgudel/hmda-platform/deployments","created_at":"2016-05-02T19:22:32Z","updated_at":"2016-05-02T19:22:35Z","pushed_at":"2016-06-13T20:24:22Z","git_url":"git://github.com/kgudel/hmda-platform.git","ssh_url":"git@github.com:kgudel/hmda-platform.git","clone_url":"https://github.com/kgudel/hmda-platform.git","svn_url":"https://github.com/kgudel/hmda-platform","homepage":"","size":4230,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cfpb:master","ref":"master","sha":"c5bc7e58d1c3609c7cbf650afbc2b92c27e55d62","user":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"repo":{"id":50141662,"name":"hmda-platform","full_name":"cfpb/hmda-platform","owner":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cfpb/hmda-platform","description":"","fork":false,"url":"https://api.github.com/repos/cfpb/hmda-platform","forks_url":"https://api.github.com/repos/cfpb/hmda-platform/forks","keys_url":"https://api.github.com/repos/cfpb/hmda-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfpb/hmda-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfpb/hmda-platform/teams","hooks_url":"https://api.github.com/repos/cfpb/hmda-platform/hooks","issue_events_url":"https://api.github.com/repos/cfpb/hmda-platform/issues/events{/number}","events_url":"https://api.github.com/repos/cfpb/hmda-platform/events","assignees_url":"https://api.github.com/repos/cfpb/hmda-platform/assignees{/user}","branches_url":"https://api.github.com/repos/cfpb/hmda-platform/branches{/branch}","tags_url":"https://api.github.com/repos/cfpb/hmda-platform/tags","blobs_url":"https://api.github.com/repos/cfpb/hmda-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfpb/hmda-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfpb/hmda-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfpb/hmda-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfpb/hmda-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/cfpb/hmda-platform/languages","stargazers_url":"https://api.github.com/repos/cfpb/hmda-platform/stargazers","contributors_url":"https://api.github.com/repos/cfpb/hmda-platform/contributors","subscribers_url":"https://api.github.com/repos/cfpb/hmda-platform/subscribers","subscription_url":"https://api.github.com/repos/cfpb/hmda-platform/subscription","commits_url":"https://api.github.com/repos/cfpb/hmda-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfpb/hmda-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfpb/hmda-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfpb/hmda-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfpb/hmda-platform/contents/{+path}","compare_url":"https://api.github.com/repos/cfpb/hmda-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfpb/hmda-platform/merges","archive_url":"https://api.github.com/repos/cfpb/hmda-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfpb/hmda-platform/downloads","issues_url":"https://api.github.com/repos/cfpb/hmda-platform/issues{/number}","pulls_url":"https://api.github.com/repos/cfpb/hmda-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/cfpb/hmda-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/cfpb/hmda-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfpb/hmda-platform/labels{/name}","releases_url":"https://api.github.com/repos/cfpb/hmda-platform/releases{/id}","deployments_url":"https://api.github.com/repos/cfpb/hmda-platform/deployments","created_at":"2016-01-21T22:39:17Z","updated_at":"2016-05-18T17:14:26Z","pushed_at":"2016-06-14T20:33:11Z","git_url":"git://github.com/cfpb/hmda-platform.git","ssh_url":"git@github.com:cfpb/hmda-platform.git","clone_url":"https://github.com/cfpb/hmda-platform.git","svn_url":"https://github.com/cfpb/hmda-platform","homepage":"","size":5681,"stargazers_count":3,"watchers_count":3,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":102,"forks":9,"open_issues":102,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cfpb/hmda-platform/pulls/402"},"html":{"href":"https://github.com/cfpb/hmda-platform/pull/402"},"issue":{"href":"https://api.github.com/repos/cfpb/hmda-platform/issues/402"},"comments":{"href":"https://api.github.com/repos/cfpb/hmda-platform/issues/402/comments"},"review_comments":{"href":"https://api.github.com/repos/cfpb/hmda-platform/pulls/402/comments"},"review_comment":{"href":"https://api.github.com/repos/cfpb/hmda-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cfpb/hmda-platform/pulls/402/commits"},"statuses":{"href":"https://api.github.com/repos/cfpb/hmda-platform/statuses/769f07cd8ba619b2efa81a3a13b1d87a4003c0ce"}}}}
{"actor":{"display_login":"lgdean"}}