HAALCENTRAAL English translation
BRP API / Personen / Features / datum

supplying a date

# language: en

Feature: supplying a date

  a date is supplied with a type based on the precision of the value

  Rule: a date is given type "Datum" where the last two digits in the GBA date are not equal to "00".
        The following applies:
        - the date is supplied in field "datum", in full-date format as defined in RFC 3339, section 5.6
        - field "type" is given the value "Datum"

    Scenario Outline: the last two digits of the GBA date are not equal to "00"
      Given the person with citizen service number '000000103' has the following 'inschrijving' data
        | naam                                  | waarde      |
        | datum eerste inschrijving GBA (68.10) | <gba datum> |
        When persons are searched with the following parameters
        | naam                | waarde                          |
        | type                | RaadpleegMetBurgerservicenummer |
        | burgerservicenummer | 000000103                       |
        | fields              | datumEersteInschrijvingGBA      |
        Then the response has a person with the following data
        | naam                                   | waarde         |
        | datumEersteInschrijvingGBA.type        | Datum          |
        | datumEersteInschrijvingGBA.datum       | <datum>        |
        | datumEersteInschrijvingGBA.langFormaat | <lang formaat> |

        Examples:
        | gba datum | datum      | lang formaat      |
        | 19350110  | 1935-01-10 | 10 januari 1935   |
        | 20200229  | 2020-02-29 | 29 februari 2020  |
        | 20200308  | 2020-03-08 | 8 maart 2020      |
        | 19390401  | 1939-04-01 | 1 april 1939      |
        | 19780914  | 1978-09-14 | 14 september 1978 |
        | 20021102  | 2002-11-02 | 2 november 2002   |

  Rule: a date is given type "JaarMaandDatum" where the last two digits in the GBA date equal "00".
        The following applies:
        - the year, which is in the first 4 digits, is supplied in field "jaar" as an integer (number)
        - the month, which is in positions 5 and 6, is supplied in field "maand" as an integer (number)
        - field "type" is given the value "JaarMaandDatum"

    Scenario Outline: the last two digits of the GBA date equal "00"
      Given the person with citizen service number '000000115' has the following data
        | naam                  | waarde      |
        | geboortedatum (03.10) | <gba datum> |
        When persons are searched with the following parameters
        | naam                | waarde                          |
        | type                | RaadpleegMetBurgerservicenummer |
        | burgerservicenummer | 000000115                       |
        | fields              | geboorte.datum                  |
        Then the response has a person with the following 'geboorte' data
        | naam              | waarde         |
        | datum.type        | JaarMaandDatum |
        | datum.jaar        | <jaar>         |
        | datum.maand       | <maand>        |
        | datum.langFormaat | <lang formaat> |


        Examples:
        | gba datum | jaar | maand | lang formaat  |
        | 20200500  | 2020 | 5     | mei 2020      |
        | 20080600  | 2008 | 6     | juni 2008     |
        | 19680700  | 1968 | 7     | juli 1968     |
        | 19720800  | 1972 | 8     | augustus 1972 |
        | 19501000  | 1950 | 10    | oktober 1950  |
        | 19991200  | 1999 | 12    | december 1999 |

  Rule: a date is given type "JaarDatum" where the last four digits in the GBA date equal "0000".
        The following applies:
        - the year, which is in the first 4 digits, is supplied in field "jaar" as an integer (number)
        - field "type" is given the value "JaarDatum"

    Scenario: the last four digits of the GBA date equal "0000"
      Given the person with citizen service number '000000127' has a parent '1' with the following data
        | naam                                               | waarde   |
        | datum ingang familierechtelijke betrekking (62.10) | 19630000 |
        When persons are searched with the following parameters
        | naam                | waarde                                         |
        | type                | RaadpleegMetBurgerservicenummer                |
        | burgerservicenummer | 000000127                                      |
        | fields              | ouders.datumIngangFamilierechtelijkeBetrekking |
        Then the response has a person with a 'ouder' with the following data
        | naam                                                | waarde    |
        | datumIngangFamilierechtelijkeBetrekking.type        | JaarDatum |
        | datumIngangFamilierechtelijkeBetrekking.jaar        | 1963      |
        | datumIngangFamilierechtelijkeBetrekking.langFormaat | 1963      |

  Rule: a date is given type "DatumOnbekend" where the GBA date equals "00000000".
        The following applies:
        - field "type" is given the value "DatumOnbekend"
        - field "onbekend" is included with the boolean value true

    Scenario: the GBA date equals "00000000"
      Given the person with citizen service number '000000139' has the following 'overlijden' data
        | naam                     | waarde   |
        | datum overlijden (08.10) | 00000000 |
        When persons are searched with the following parameters
        | naam                | waarde                          |
        | type                | RaadpleegMetBurgerservicenummer |
        | burgerservicenummer | 000000139                       |
        | fields              | overlijden.datum                |
        Then the response has a person with the following 'overlijden' data
        | naam               | waarde        |
        | datum.type         | DatumOnbekend |
        | datum.onbekend     | true          |
        | datum.langFormaat  | onbekend      |