Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbJson 2.0 primaryLocation #65

Closed
2 tasks done
stansmith907 opened this issue Mar 7, 2017 · 0 comments
Closed
2 tasks done

sbJson 2.0 primaryLocation #65

stansmith907 opened this issue Mar 7, 2017 · 0 comments

Comments

@stansmith907
Copy link
Contributor

stansmith907 commented Mar 7, 2017

Mapping of sbJson primaryLocation to mdTranslator internal data structure:

  • reader complete
  • writer complete
         "primaryLocation": {
            "shortName": "asdf",
            "name": "Robert N Prescott/BRD/CONT/USGS/DOI - Primary Location",
            "description": "asdf",
            "location": "asdf",
            "building": "NRRC Bldg C",
            "buildingCode": "KBA",
            "roomNumber": "123",
            "officePhone": "9702269250",
            "faxPhone": "9702269230",
            "latitude": 20,
            "longitude": 20,
            "streetAddress": {
               "line1": "2150 Centre Avenue Bldg C",
               "line2": "sadf",
               "mailStopCode": "safd",
               "city": "Fort Collins",
               "state": "CO",
               "zip": "80526",
               "country": "asdf"
            },
            "mailAddress": {
               "line1": "2150 Centre Avenue, Building C",
               "line2": "asdf",
               "mailStopCode": "asdf",
               "city": "Fort Collins",
               "state": "CO",
               "zip": "80526-8118",
               "country": "USA"
            }
         }

Definition: (none)

Mapping...

  • description: (none)
    Map to contacts address description
    [schema][contacts][n][addresses][n].description
    view mdTools
  • officePhone/faxPhone: (none)
    Map to contacts phones
    [schema][contacts][n][phones][n].phoneName
    view mdTools
    [schema][contacts][n][phones][n].phoneNumber
    view mdTools
    [schema][contacts][n][phones][n].phoneServiceTypes
    view mdTools
  • streetAddress/mailAddress: (none)
    • line1/line2: (none)
      Map to contacts address deliveryPoints
      [schema][contacts][n][addresses][n][deliveryPoints][n]
      view mdTools
    • city: (none)
      Map to contacts address city
      [schema][contacts][n][addresses][n].city
      view mdTools
    • state: (none)
      Map to contacts address adminArea
      [schema][contacts][n][addresses][n].city
      view mdTools
    • zip: (none)
      Map to contacts address postalCode
      [schema][contacts][n][addresses][n].postalCode
      view mdTools
    • country: (none)
      Map to contacts address country
      [schema][contacts][n][addresses][n].country
      view mdTools

Not Mapped...

  • shortName
  • name
  • location
  • building
  • buildingCode
  • roomNumber
  • latitude
  • longitude
  • mailStopCode

Mapping to mdTranslator

   def newBase
      intObj = {
         contacts: [
            {
               contactId: 'CID001',
               isOrganization: false,
               name: 'Robert N Prescott',
               phones: [
                  {
                     phoneName: 'TTY',
                     phoneNumber: '123-123-1234',
                     phoneServiceTypes: ['tty']
                  },
                  {
                     phoneName: 'Office',
                     phoneNumber: '9702269250',
                     phoneServiceTypes: ['voice']
                  },
                  {
                     phoneName: 'Fax',
                     phoneNumber: '9702269230',
                     phoneServiceTypes: ['facsimile']
                  }
               ],
               addresses: [
                  {
                     addressTypes: ['mailing', 'physical'],
                     description: 'asdf',
                     deliveryPoints: [
                        '150 Centre Avenue Bldg C',
                        'sadf'
                     ],
                     city: 'Fort Collins',
                     adminArea: 'CO',
                     postalCode: '80526',
                     country: 'asdf'
                  }
               ]
            }
         ]
      }
   end

Translation to mdJson

{
   "contacts": [
      {
         "contactId": "CID001",
         "isOrganization": false,
         "name": "Robert N Prescott",
         "phone": [
            {
               "phoneName": "TTY",
               "phoneNumber": "123-123-1234",
               "service": ["tty"]
            },
            {
               "phoneName": "Office",
               "phoneNumber": "9702269250",
               "service": ["voice"]
            },
            {
               "phoneName": "Fax",
               "phoneNumber": "9702269230",
               "service": ["facsimile"]
            }
         ],
         "address": [
            {
               "addressType": ["mailing", "facsimile"],
               "description": "asdf",
               "deliveryPoint": [
                  "150 Centre Avenue Bldg C",
                  "sadf"
               ],
               "city": "Fort Collins",
               "administrativeArea": "CO",
               "postalCode": "80526",
               "country": "asdf"
            }
         ]
      }
   ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants