package gov.cms.grouper.snf.component.r3;


import gov.cms.grouper.snf.SnfComponentVersion;
import gov.cms.grouper.snf.lego.SnfComparator;

public class SnfComponent extends gov.cms.grouper.snf.component.r2.SnfComponent {

  private static final int OBRA_STARTVERSION = 105;

  public SnfComponent() {
    this(OBRA_STARTVERSION);
  }


  public SnfComponent(int dataVersion) {
    super(dataVersion);
    if (SnfComparator.betweenInclusive(SnfComponentVersion.r3.getFrom(), dataVersion,
        SnfComponentVersion.r3.getTo()) == false) {
      throw new RuntimeException("Version miss match");
    }
  }


  @Override
  public Boolean hasIPA(Integer aiCode, Integer obra) {
    Boolean result = null;
    if (obra != null && obra != 99 && aiCode == null) {
      // OBRA assessment
      result = false;
    } else {
      result = super.hasIPA(aiCode, obra);
    }

    return result;

  }



}
